Merge branch 'develop' of github.com:atm-maxime/dolibarr into new_bom_cost
This commit is contained in:
commit
0512b3a7a7
2
.github/workflows/stale-issues-safe.yml
vendored
2
.github/workflows/stale-issues-safe.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).'
|
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).'
|
||||||
stale-label: 'Issue Stale (automatic label)'
|
stale-label: 'Issue Stale (automatic label)'
|
||||||
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE)'
|
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE),Analysis of PR in progres'
|
||||||
days-before-stale: 365
|
days-before-stale: 365
|
||||||
days-before-close: 15
|
days-before-close: 15
|
||||||
operations-per-run: 100
|
operations-per-run: 100
|
||||||
|
|||||||
@ -282,7 +282,7 @@ script:
|
|||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
#parallel-lint --exclude htdocs/includes --blame .
|
#parallel-lint --exclude htdocs/includes --blame .
|
||||||
parallel-lint --exclude dev/namespacemig --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|||||||
@ -102,10 +102,13 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi
|
|||||||
; Put here path of Wampserver applications
|
; Put here path of Wampserver applications
|
||||||
; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45
|
; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45
|
||||||
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45
|
; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45
|
||||||
; Value OK: apache 2.4.19, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
; Value OK: apache 2.4.9, php 5.5.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||||
|
; Value To test: apache 2.4.41, php 7.3.12, mysql 5.0.45 instead of 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe)
|
||||||
Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
|
Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange"
|
||||||
Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
;Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||||
Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
Source: "C:\wamp64\bin\apache\apache2.4.41\*.*"; DestDir: "{app}\bin\apache\apache2.4.41"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log"
|
||||||
|
;Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||||
|
Source: "C:\wamp64\bin\php\php7.3.12\*.*"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log"
|
||||||
Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
|
Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe"
|
||||||
; Mysql data files (does not overwrite if exists)
|
; Mysql data files (does not overwrite if exists)
|
||||||
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
||||||
@ -119,9 +122,11 @@ Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".
|
|||||||
Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion;
|
;Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion;
|
||||||
|
Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.41\conf"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion;
|
;Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion;
|
||||||
|
Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.12"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion;
|
||||||
Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
|
Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion;
|
||||||
@ -227,8 +232,10 @@ procedure InitializeWizard();
|
|||||||
begin
|
begin
|
||||||
|
|
||||||
//version des applis, a modifier pour chaque version de WampServer 2
|
//version des applis, a modifier pour chaque version de WampServer 2
|
||||||
apacheVersion := '2.4.9';
|
//apacheVersion := '2.4.9';
|
||||||
phpVersion := '5.5.12' ;
|
//phpVersion := '5.5.12' ;
|
||||||
|
apacheVersion := '2.4.41';
|
||||||
|
phpVersion := '7.3.12' ;
|
||||||
mysqlVersion := '5.0.45';
|
mysqlVersion := '5.0.45';
|
||||||
phpmyadminVersion := '4.1.14';
|
phpmyadminVersion := '4.1.14';
|
||||||
|
|
||||||
@ -392,40 +399,42 @@ begin
|
|||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
// TODO Update this list when changing PHP/Apache versions
|
// TODO Update this list when changing PHP/Apache versions
|
||||||
|
|
||||||
phpDllCopy := 'fdftk.dll';
|
// phpDllCopy := 'fdftk.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'fribidi.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'gds32.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libeay32.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libmhash.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libmysql.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libpq.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'msql.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libmcrypt.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'libmysqli.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'ntwdblib.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
|
||||||
|
// phpDllCopy := 'php5activescript.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
// phpDllCopy := 'php5nsapi.dll';
|
||||||
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
phpDllCopy := 'php7apache2_4.dll';
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
phpDllCopy := 'fribidi.dll';
|
phpDllCopy := 'php7ts.dll';
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'gds32.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libeay32.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libmhash.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libmysql.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libpq.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'msql.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libmcrypt.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'libmysqli.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'ntwdblib.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
|
|
||||||
phpDllCopy := 'php5activescript.dll';
|
// phpDllCopy := 'ssleay32.dll';
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
phpDllCopy := 'php5nsapi.dll';
|
// phpDllCopy := 'yaz.dll';
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
// filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
||||||
phpDllCopy := 'php5ts.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
|
|
||||||
phpDllCopy := 'ssleay32.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
phpDllCopy := 'yaz.dll';
|
|
||||||
filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
|
|
||||||
|
|
||||||
|
|
||||||
// Remove lock file
|
// Remove lock file
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# \file build/makepack-dolibarr.pl
|
# \file build/makepack-dolibarr.pl
|
||||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||||
# \author (c)2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
# \author (c)2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||||
@ -430,12 +430,14 @@ if ($nboftargetok) {
|
|||||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||||
print 'Run git push -f --tags'."\n";
|
print 'Run git push -f --tags'."\n";
|
||||||
$ret=`git push -f --tags`;
|
$ret=`git push -f --tags`;
|
||||||
|
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print 'Run git push --tags'."\n";
|
print 'Run git push --tags'."\n";
|
||||||
$ret=`git push --tags`;
|
$ret=`git push --tags`;
|
||||||
|
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
|
||||||
}
|
}
|
||||||
chdir("$olddir");
|
chdir("$olddir");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -622,7 +622,7 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
'default' => $deljournal
|
'default' => $deljournal
|
||||||
);
|
);
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 300);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -197,7 +197,7 @@ if ($resql) {
|
|||||||
|
|
||||||
$param="&socid=".$socid;
|
$param="&socid=".$socid;
|
||||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||||
|
|
||||||
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
||||||
|
|||||||
@ -195,7 +195,7 @@ if ($resql) {
|
|||||||
|
|
||||||
$param="&socid=".$socid;
|
$param="&socid=".$socid;
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
print '<input type="hidden" name="socid" value="' . $object->id . '">';
|
||||||
|
|
||||||
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
|
||||||
|
|||||||
@ -332,7 +332,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||||
$clickpicto = $form->showCheckAddButtons();
|
$clickpicto = $form->showCheckAddButtons();
|
||||||
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -341,7 +341,7 @@ if ($result) {
|
|||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
while ($objp = $db->fetch_object($result)) {
|
while ($objp = $db->fetch_object($result)) {
|
||||||
$codecompta = length_accountg($objp->account_number).' - '.$objp->label_compte;
|
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label_compte.'</span>';
|
||||||
|
|
||||||
$facture_static->ref = $objp->ref;
|
$facture_static->ref = $objp->ref;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
@ -390,7 +390,7 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td>'.$objp->tva_intra.'</td>';
|
print '<td>'.$objp->tva_intra.'</td>';
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -287,7 +287,7 @@ if ($result) {
|
|||||||
|
|
||||||
while ($i < min($num_lines, $limit)) {
|
while ($i < min($num_lines, $limit)) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$codeCompta = length_accountg($objp->account_number).' - '.$objp->label;
|
$codeCompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
|
||||||
|
|
||||||
$expensereport_static->ref = $objp->ref;
|
$expensereport_static->ref = $objp->ref;
|
||||||
$expensereport_static->id = $objp->erid;
|
$expensereport_static->id = $objp->erid;
|
||||||
@ -315,7 +315,7 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td>'.$codeCompta.'</td>';
|
print '<td>'.$codeCompta.'</td>';
|
||||||
|
|
||||||
print '<td class="left"><a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
print '<td class="left"><a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|
||||||
|
|||||||
@ -336,7 +336,7 @@ if ($result) {
|
|||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||||
$checkpicto = $form->showCheckAddButtons();
|
$checkpicto = $form->showCheckAddButtons();
|
||||||
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -347,7 +347,7 @@ if ($result) {
|
|||||||
while ($i < min($num_lines, $limit)) {
|
while ($i < min($num_lines, $limit)) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$codecompta = length_accountg($objp->account_number).' - '.$objp->label;
|
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
|
||||||
|
|
||||||
$facturefournisseur_static->ref = $objp->ref;
|
$facturefournisseur_static->ref = $objp->ref;
|
||||||
$facturefournisseur_static->id = $objp->facid;
|
$facturefournisseur_static->id = $objp->facid;
|
||||||
@ -399,7 +399,7 @@ if ($result) {
|
|||||||
|
|
||||||
print '<td>'.$objp->tva_intra.'</td>';
|
print '<td>'.$objp->tva_intra.'</td>';
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|||||||
@ -259,7 +259,7 @@ print '<br>';
|
|||||||
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="foruserid" value="all">';
|
print '<input type="hidden" name="foruserid" value="all">';
|
||||||
print '<input type="hidden" name="mode" value="card">';
|
print '<input type="hidden" name="mode" value="card">';
|
||||||
print '<input type="hidden" name="action" value="builddoc">';
|
print '<input type="hidden" name="action" value="builddoc">';
|
||||||
@ -279,7 +279,7 @@ print '<br><br>';
|
|||||||
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="mode" value="cardlogin">';
|
print '<input type="hidden" name="mode" value="cardlogin">';
|
||||||
print '<input type="hidden" name="action" value="builddoc">';
|
print '<input type="hidden" name="action" value="builddoc">';
|
||||||
print $langs->trans("DescADHERENT_CARD_TYPE").' ';
|
print $langs->trans("DescADHERENT_CARD_TYPE").' ';
|
||||||
@ -299,7 +299,7 @@ print '<br><br>';
|
|||||||
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
|
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="mode" value="label">';
|
print '<input type="hidden" name="mode" value="label">';
|
||||||
print '<input type="hidden" name="action" value="builddoc">';
|
print '<input type="hidden" name="action" value="builddoc">';
|
||||||
print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' ';
|
print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' ';
|
||||||
|
|||||||
@ -297,7 +297,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||||
if ($user->rights->adherent->configurer)
|
if ($user->rights->adherent->configurer)
|
||||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||||
else
|
else
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
@ -607,7 +607,7 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
|
print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -110,56 +110,60 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="oddeven liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_NAME?$conf->global->MAIN_INFO_ACCOUNTANT_NAME: GETPOST("nom", 'nohtml')) . '"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address", 'nohtml')) . '</textarea></td></tr>'."\n";
|
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS?$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS: GETPOST("address", 'nohtml')) . '</textarea></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode", 'alpha')) . '"></td></tr>'."\n";
|
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_ZIP?$conf->global->MAIN_INFO_ACCOUNTANT_ZIP: GETPOST("zipcode", 'alpha')) . '"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town", 'nohtml')) . '"></td></tr>'."\n";
|
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_TOWN?$conf->global->MAIN_INFO_ACCOUNTANT_TOWN: GETPOST("town", 'nohtml')) . '"></td></tr>'."\n";
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
|
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
|
||||||
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
|
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id');
|
$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id');
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_PHONE . '"></td></tr>';
|
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_PHONE . '"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_FAX . '"></td></tr>';
|
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_FAX . '"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_MAIL . '"></td></tr>';
|
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_MAIL . '"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||||
|
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_WEB . '"></td></tr>';
|
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_ACCOUNTANT_WEB . '"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Code
|
// Code
|
||||||
print '<tr><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||||
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '"></td></tr>'."\n";
|
print '<input name="code" id="code" class="minwidth100" value="'. ($conf->global->MAIN_INFO_ACCOUNTANT_CODE?$conf->global->MAIN_INFO_ACCOUNTANT_CODE: GETPOST("code", 'nohtml')) . '"></td></tr>'."\n";
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
|
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="action" value="set">';
|
print '<input type="hidden" name="action" value="set">';
|
||||||
|
|
||||||
print '<table class="noborder allwidth">'."\n";
|
print '<table class="noborder allwidth">'."\n";
|
||||||
|
|||||||
@ -180,7 +180,7 @@ $head=agenda_prepare_head();
|
|||||||
dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action');
|
dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="action" value="set">';
|
print '<input type="hidden" name="action" value="set">';
|
||||||
|
|
||||||
print '<table class="noborder allwidth">'."\n";
|
print '<table class="noborder allwidth">'."\n";
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL))
|
|||||||
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
|
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
|
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
|
||||||
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
|
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
|
||||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
||||||
|
|||||||
@ -451,27 +451,33 @@ print '</td></tr>'."\n";
|
|||||||
|
|
||||||
// Phone
|
// Phone
|
||||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'"></td></tr>';
|
print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Fax
|
// Fax
|
||||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).'"></td></tr>';
|
print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Email
|
// Email
|
||||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||||
|
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'"></td></tr>';
|
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||||
|
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'"></td></tr>';
|
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Barcode
|
// Barcode
|
||||||
if (!empty($conf->barcode->enabled)) {
|
if (!empty($conf->barcode->enabled)) {
|
||||||
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
|
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||||
|
print '<span class="fa paddingright fa-barcode"></span>';
|
||||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).'"></td></tr>';
|
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).'"></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -480,15 +486,16 @@ if (!empty($conf->barcode->enabled)) {
|
|||||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
||||||
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||||
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
|
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
|
||||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
print '</div>';
|
||||||
if (!empty($mysoc->logo_mini)) {
|
if (!empty($mysoc->logo_mini)) {
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
|
||||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||||
print '</div><div class="inline-block valignmiddle">';
|
print '<div class="inline-block valignmiddle">';
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -497,15 +504,16 @@ print '</td></tr>';
|
|||||||
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
||||||
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||||
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
print '</div>';
|
||||||
if (!empty($mysoc->logo_squarred_mini)) {
|
if (!empty($mysoc->logo_squarred_mini)) {
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a>';
|
|
||||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
|
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
|
||||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
print '<div class="inline-block valignmiddle marginrightonly">';
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -524,35 +532,15 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Facebook
|
$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github');
|
||||||
print '<tr class="oddeven"><td><label for="facebookurl">'.$langs->trans("SocialNetworksFacebookURL").'</label></td><td>';
|
foreach($listofnetworks as $networkkey => $networkicon) {
|
||||||
print '<input name="facebookurl" id="facebookurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FACEBOOK_URL).'"></td></tr>';
|
print '<tr class="oddeven"><td>';
|
||||||
print '</td></tr>'."\n";
|
print '<label for="'.$networkkey.'url">'.$langs->trans("SocialNetworks".ucfirst($networkkey)."URL").'</label></td><td>';
|
||||||
|
$networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL';
|
||||||
// Twitter
|
print '<span class="fa paddingright fa-'.($networkicon ? $networkicon : 'link').'"></span>';
|
||||||
print '<tr class="oddeven"><td><label for="twitterurl">'.$langs->trans("SocialNetworksTwitterURL").'</label></td><td>';
|
print '<input name="'.$networkkey.'url" id="'.$networkkey.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconst).'"></td></tr>';
|
||||||
print '<input name="twitterurl" id="twitterurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TWITTER_URL).'"></td></tr>';
|
print '</td></tr>'."\n";
|
||||||
print '</td></tr>'."\n";
|
}
|
||||||
|
|
||||||
// LinkedIn
|
|
||||||
print '<tr class="oddeven"><td><label for="linkedinurl">'.$langs->trans("SocialNetworksLinkedinURL").'</label></td><td>';
|
|
||||||
print '<input name="linkedinurl" id="linkedinurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_LINKEDIN_URL).'"></td></tr>';
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
// Instagram
|
|
||||||
print '<tr class="oddeven"><td><label for="instagramurl">'.$langs->trans("SocialNetworksInstagramURL").'</label></td><td>';
|
|
||||||
print '<input name="instagramurl" id="instagramurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL).'"></td></tr>';
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
// Youtube
|
|
||||||
print '<tr class="oddeven"><td><label for="youtubeurl">'.$langs->trans("SocialNetworksYoutubeURL").'</label></td><td>';
|
|
||||||
print '<input name="youtubeurl" id="youtubeurl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL).'"></td></tr>';
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
// Github
|
|
||||||
print '<tr class="oddeven"><td><label for="githuburl">'.$langs->trans("SocialNetworksGithubURL").'</label></td><td>';
|
|
||||||
print '<input name="githuburl" id="githuburl" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL).'"></td></tr>';
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@ -707,26 +695,24 @@ print "</table>";
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="140">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
print '<td width="25%">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print "<table>";
|
$tooltiphelp = '';
|
||||||
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
|
if ($mysoc->country_code == 'FR') $tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
|
||||||
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i></td></tr>\n";
|
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
|
||||||
print "</table>";
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print "<table>";
|
$tooltiphelp = '';
|
||||||
print "<tr><td><label for=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
|
if ($mysoc->country_code == 'FR') $tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
|
||||||
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i></td></tr>\n";
|
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
|
||||||
print "</table>";
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -740,40 +726,35 @@ if ($mysoc->useLocalTax(1))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="140">'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
print '<td width="25%">'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print '<table class="nobordernopadding">';
|
print '<div class="nobordernopadding">';
|
||||||
print "<tr><td><label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||||
$example = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
print ($example != "LocalTax1IsUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
print "<label for=\"lt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||||
if (!isOnlyOneLocalTax(1))
|
if (!isOnlyOneLocalTax(1))
|
||||||
{
|
{
|
||||||
print '<tr><td class="left"><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||||
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$opcions = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
$opcions = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
||||||
|
|
||||||
print '<tr><td class="left"></label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
print '<br><label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||||
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
||||||
print '</td></tr>';
|
print "</div>";
|
||||||
print "</table>";
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print "<table>";
|
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||||
print "<tr><td><label for=\"nolt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
$example = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||||
print ($example != "LocalTax1IsNotUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
|
||||||
print "</table>";
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
@ -783,38 +764,34 @@ if ($mysoc->useLocalTax(2))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
print '<td width="25%">'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print '<table class="nobordernopadding">';
|
print '<div class="nobordernopadding">';
|
||||||
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
print "<label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||||
$example = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
$tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
||||||
print ($example != "LocalTax2IsUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
$tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
if (!isOnlyOneLocalTax(2))
|
if (!isOnlyOneLocalTax(2))
|
||||||
{
|
{
|
||||||
print '<tr><td class="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
print '<br><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
||||||
$formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
$formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
print '<tr><td class="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
print '<br><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||||
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
||||||
print '</td></tr>';
|
print "</div>";
|
||||||
print "</table>";
|
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print "<table>";
|
print "<div>";
|
||||||
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
|
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||||
$example = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
$tooltiphelp = ($tooltiphelp != "LocalTax2IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
print ($example != "LocalTax2IsNotUsedExample" ? "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n" : "");
|
print "<label for=\"nolt2\">".$form->textwithpicto($langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||||
print "</table>";
|
print "</div>";
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,7 +207,7 @@ llxHeader();
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->transnoentities("DelaysOfToleranceDesc", img_warning());
|
print '<span class="opacitymedium">'.$langs->transnoentities("DelaysOfToleranceDesc", img_warning('default', '', 'pictowarning nopaddingleft'));
|
||||||
print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."</span><br>\n";
|
print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."</span><br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,7 @@ else
|
|||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
|
|
||||||
// Skins
|
// Skins
|
||||||
show_skin(null, 1);
|
show_skin(null, 1);
|
||||||
|
|||||||
@ -207,29 +207,29 @@ if (empty($mysoc->country_code))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show examples
|
// Show examples
|
||||||
print '<b>'.$langs->trans("ExamplesWithCurrentSetup").":</b><br>\n";
|
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
|
||||||
|
|
||||||
// Always show vat rates with vat 0
|
// Always show vat rates with vat 0
|
||||||
$s=2/7;$qty=1;$vat=0;
|
$s=2/7;$qty=1;$vat=0;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
|
|
||||||
$s=10/3;$qty=1;$vat=0;
|
$s=10/3;$qty=1;$vat=0;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
|
|
||||||
$s=10/3;$qty=2;$vat=0;
|
$s=10/3;$qty=2;$vat=0;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
|
|
||||||
// Add vat rates examples specific to country
|
// Add vat rates examples specific to country
|
||||||
$vat_rates=array();
|
$vat_rates=array();
|
||||||
@ -261,10 +261,10 @@ else
|
|||||||
{
|
{
|
||||||
$s=10/3;
|
$s=10/3;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,17 +276,17 @@ else
|
|||||||
|
|
||||||
$s=10/3;$qty=1;$vat=10;
|
$s=10/3;$qty=1;$vat=10;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
|
|
||||||
$s=10/3;$qty=2;$vat=10;
|
$s=10/3;$qty=2;$vat=10;
|
||||||
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
$tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
|
||||||
print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU');
|
print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
|
||||||
print " x ".$langs->trans("Quantity").": ".$qty;
|
print " x ".$langs->trans("Quantity").": ".$qty;
|
||||||
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
print " - ".$langs->trans("VAT").": ".$vat.'%';
|
||||||
print " -> ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
print ' -> <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Important: can debug rounding, to simulate the rounded total
|
// Important: can debug rounding, to simulate the rounded total
|
||||||
|
|||||||
@ -290,7 +290,7 @@ $text='';
|
|||||||
|
|
||||||
if ($mode == 'desc')
|
if ($mode == 'desc')
|
||||||
{
|
{
|
||||||
if ($moduledesc) $text.=$moduledesc.'<br><br>';
|
if ($moduledesc) $text .= '<br>'.$moduledesc.'<br><br><br>';
|
||||||
|
|
||||||
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
||||||
|
|
||||||
|
|||||||
@ -552,7 +552,7 @@ if ($mode == 'common')
|
|||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
// Show list of modules
|
// Show list of modules
|
||||||
|
//$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1;
|
||||||
$oldfamily = '';
|
$oldfamily = '';
|
||||||
|
|
||||||
foreach ($orders as $key => $value)
|
foreach ($orders as $key => $value)
|
||||||
@ -637,8 +637,12 @@ if ($mode == 'common')
|
|||||||
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
|
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
|
||||||
print load_fiche_titre($familytext, '', '');
|
print load_fiche_titre($familytext, '', '');
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
|
print '<div class="box-flex-container">';
|
||||||
|
} else {
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
$atleastoneforfamily = 0;
|
$atleastoneforfamily = 0;
|
||||||
}
|
}
|
||||||
@ -651,9 +655,6 @@ if ($mode == 'common')
|
|||||||
$oldfamily = $familykey;
|
$oldfamily = $familykey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Version (with picto warning or not)
|
// Version (with picto warning or not)
|
||||||
$version = $objMod->getVersion(0);
|
$version = $objMod->getVersion(0);
|
||||||
$versiontrans = '';
|
$versiontrans = '';
|
||||||
@ -669,6 +670,10 @@ if ($mode == 'common')
|
|||||||
$imginfo = "info_black";
|
$imginfo = "info_black";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
|
// Output Kanban
|
||||||
|
print $objMod->getKanbanView();
|
||||||
|
} else {
|
||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
||||||
|
|
||||||
@ -870,12 +875,17 @@ if ($mode == 'common')
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($oldfamily)
|
if ($oldfamily)
|
||||||
{
|
{
|
||||||
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
|
print '</div>';
|
||||||
|
} else {
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|||||||
@ -148,7 +148,10 @@ elseif ($action == 'setapilayer')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
$result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
||||||
|
if ($result > 0) {
|
||||||
|
setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -167,7 +167,7 @@ if ($savehandler == 'files')
|
|||||||
|
|
||||||
if (count($listofsessions) == 0)
|
if (count($listofsessions) == 0)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("NoSessionFound", $savepath, $openbasedir).'</td></tr>';
|
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoSessionFound", $savepath, $openbasedir).'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,6 +56,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
|
|
||||||
|
|
||||||
$url = $_SERVER['PHP_SELF'];
|
$url = $_SERVER['PHP_SELF'];
|
||||||
|
if (preg_match('/api\/index\.php$/', $url)) { // sometimes $_SERVER['PHP_SELF'] is 'api\/index\.php' instead of 'api\/index\.php/explorer.php' or 'api\/index\.php/method'
|
||||||
|
$url = $_SERVER['PHP_SELF'].$_SERVER['PATH_INFO'];
|
||||||
|
}
|
||||||
// Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases)
|
// Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases)
|
||||||
if (! empty($conf->global->MAIN_NGINX_FIX))
|
if (! empty($conf->global->MAIN_NGINX_FIX))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -203,7 +203,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||||
{
|
{
|
||||||
$res = $object->fetch_optionals($object->id);
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = asset_prepare_head($object);
|
$head = asset_prepare_head($object);
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||||
|
|||||||
@ -549,7 +549,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
|||||||
@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi
|
|||||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val)
|
|||||||
elseif (strpos($val['type'], 'integer:') === 0) {
|
elseif (strpos($val['type'], 'integer:') === 0) {
|
||||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||||
}
|
}
|
||||||
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||||
|
|
||||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||||
|
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||||
|
|
||||||
if (!empty($arrayfields['t.'.$key]['checked']))
|
if (!empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,10 +60,9 @@ function printDropdownBookmarksList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'onsubmit="return false"':'').'>';
|
||||||
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
|
||||||
$searchForm .= '</form>';
|
|
||||||
|
|
||||||
// Url to list bookmark
|
// Url to list bookmark
|
||||||
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||||
@ -79,7 +78,6 @@ function printDropdownBookmarksList()
|
|||||||
$newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
$newbtn .= img_picto('', 'bookmark', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
|
|
||||||
// Menu with list of bookmarks
|
// Menu with list of bookmarks
|
||||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
$sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
$sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||||
@ -87,21 +85,86 @@ function printDropdownBookmarksList()
|
|||||||
$sql .= " ORDER BY position";
|
$sql .= " ORDER BY position";
|
||||||
if ($resql = $db->query($sql))
|
if ($resql = $db->query($sql))
|
||||||
{
|
{
|
||||||
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
|
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while (($conf->global->BOOKMARKS_SHOW_IN_MENU == 0 || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$bookmarkList .= '<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
|
$bookmarkList .= '<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||||
$bookmarkList .= dol_escape_htmltag($obj->title);
|
$bookmarkList .= dol_escape_htmltag($obj->title);
|
||||||
$bookmarkList .= '</a>';
|
$bookmarkList .= '</a>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$bookmarkList .= '</div>';
|
||||||
|
|
||||||
|
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
|
} else {
|
||||||
|
$searchForm .= '<select name"=bookmark" id="boxbookmark" class="topmenu-bookmark-dropdown .dropdown-toggle">';
|
||||||
|
//$searchForm .= '<option>--'.$langs->trans("Bookmarks").'--</option>';
|
||||||
|
$searchForm .= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
|
||||||
|
$searchForm .= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
|
||||||
|
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
||||||
|
$searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
|
||||||
|
// Url to go on create new bookmark page
|
||||||
|
if (! empty($user->rights->bookmark->creer))
|
||||||
|
{
|
||||||
|
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||||
|
$searchForm .= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
|
||||||
|
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
|
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
|
||||||
|
$searchForm .= dol_escape_htmltag($obj->title);
|
||||||
|
$searchForm .= '</option>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$searchForm .= '</select>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
$bookmarkList .= '</div>';
|
|
||||||
|
|
||||||
|
$searchForm .= '</form>';
|
||||||
|
|
||||||
|
// Generate the return string
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
|
$html = $searchForm;
|
||||||
|
|
||||||
|
$html.='<!-- script to open selected choice -->
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
jQuery("#boxbookmark").change(function() {
|
||||||
|
var urlselected = jQuery("#boxbookmark option:selected").attr("rel");
|
||||||
|
if (! urlselected) console.log("Error, failed to get the URL to jump to from the rel attribute");
|
||||||
|
var urltarget = jQuery("#boxbookmark option:selected").attr("target");
|
||||||
|
if (! urltarget) { urltarget=""; }
|
||||||
|
jQuery("form#top-menu-action-bookmark").attr("target",urltarget);
|
||||||
|
jQuery("form#top-menu-action-bookmark").attr("action",urlselected);
|
||||||
|
|
||||||
|
console.log("We change select bookmark. We choose urlselected="+urlselected+" with target="+urltarget);
|
||||||
|
|
||||||
|
// Method is POST for internal link, GET for external
|
||||||
|
if (urlselected.startsWith(\'http\'))
|
||||||
|
{
|
||||||
|
var newmethod=\'GET\';
|
||||||
|
jQuery("form#top-menu-action-bookmark").attr("method", newmethod);
|
||||||
|
console.log("We change method to newmethod="+newmethod);
|
||||||
|
jQuery("form#top-menu-action-bookmark").submit();
|
||||||
|
console.log("We restore method to POST");
|
||||||
|
jQuery("form#top-menu-action-bookmark").attr("method", \'POST\');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jQuery("form#top-menu-action-bookmark").submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>';
|
||||||
|
} else {
|
||||||
$html = '
|
$html = '
|
||||||
<!-- search input -->
|
<!-- search input -->
|
||||||
<div class="dropdown-header bookmark-header">
|
<div class="dropdown-header bookmark-header">
|
||||||
@ -124,7 +187,8 @@ function printDropdownBookmarksList()
|
|||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
$html .= '<script>
|
$html .= '<!-- script to open/close the popup -->
|
||||||
|
<script>
|
||||||
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||||
|
|
||||||
var filter = $(this).val(), count = 0;
|
var filter = $(this).val(), count = 0;
|
||||||
@ -140,6 +204,7 @@ function printDropdownBookmarksList()
|
|||||||
$("#top-bookmark-search-filter-count").text(count);
|
$("#top-bookmark-search-filter-count").text(count);
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,7 +243,49 @@ class Categorie extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
|
global $hookmanager;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
|
if (is_object($hookmanager)) {
|
||||||
|
$hookmanager->initHooks(array('category'));
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('constructCategory', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook >= 0 && !empty($hookmanager->resArray)) {
|
||||||
|
$mapList = $hookmanager->resArray;
|
||||||
|
$mapId = $mapList['id'];
|
||||||
|
$mapCode = $mapList['code'];
|
||||||
|
self::$MAP_ID_TO_CODE[$mapId] = $mapCode;
|
||||||
|
$this->MAP_ID[$mapCode] = $mapId;
|
||||||
|
$this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk'];
|
||||||
|
$this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table'];
|
||||||
|
$this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class'];
|
||||||
|
$this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get map list
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getMapList()
|
||||||
|
{
|
||||||
|
$mapList = array();
|
||||||
|
|
||||||
|
foreach ($this->MAP_ID as $mapCode => $mapId) {
|
||||||
|
$mapList[] = array(
|
||||||
|
'id' => $mapId,
|
||||||
|
'code' => $mapCode,
|
||||||
|
'cat_fk' => $this->MAP_CAT_FK[$mapCode],
|
||||||
|
'cat_table' => $this->MAP_CAT_TABLE[$mapCode],
|
||||||
|
'obj_class' => $this->MAP_OBJ_CLASS[$mapCode],
|
||||||
|
'obj_table' => $this->MAP_OBJ_TABLE[$mapCode]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $mapList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $id = GETPOST('id', 'int');
|
|||||||
$type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT);
|
$type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT);
|
||||||
$catname = GETPOST('catname', 'alpha');
|
$catname = GETPOST('catname', 'alpha');
|
||||||
|
|
||||||
|
$categstatic = new Categorie($db);
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
|
|
||||||
@ -47,25 +48,13 @@ if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backwar
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$categstatic = new Categorie($db);
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; }
|
$typetext = $type;
|
||||||
elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; }
|
if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea');
|
||||||
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
|
elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea');
|
||||||
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
|
elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea');
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
|
else $title = $langs->trans(ucfirst($type). 'sCategoriesArea');
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; }
|
|
||||||
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
|
||||||
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
|
||||||
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; }
|
|
||||||
elseif ($type == Categorie::TYPE_ACTIONCOMM) {
|
|
||||||
$title = $langs->trans("ActionCommCategoriesArea");
|
|
||||||
$typetext = 'actioncomm';
|
|
||||||
} else {
|
|
||||||
$title = $langs->trans("CategoriesArea");
|
|
||||||
$typetext = 'unknown';
|
|
||||||
}
|
|
||||||
|
|
||||||
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||||
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
||||||
|
|||||||
@ -37,14 +37,12 @@ $langs->loadlangs(array('categories', 'bills'));
|
|||||||
|
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$ref = GETPOST('ref');
|
$label = GETPOST('label', 'alpha');
|
||||||
$type = GETPOST('type');
|
$type = GETPOST('type');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
|
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if ($id == '' && $label == '')
|
||||||
|
|
||||||
if ($id == "")
|
|
||||||
{
|
{
|
||||||
dol_print_error('', 'Missing parameter id');
|
dol_print_error('', 'Missing parameter id');
|
||||||
exit();
|
exit();
|
||||||
@ -54,13 +52,17 @@ if ($id == "")
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
if ($id > 0)
|
$result = $object->fetch($id, $label, $type);
|
||||||
{
|
if ($result <= 0) {
|
||||||
$result = $object->fetch($id);
|
dol_print_error($db, $object->error); exit;
|
||||||
|
|
||||||
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
|
||||||
}
|
}
|
||||||
|
$object->fetch_optionals();
|
||||||
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db, $object->error); exit;
|
||||||
|
}
|
||||||
|
$upload_dir = $conf->categorie->multidir_output[$object->entity];
|
||||||
|
|
||||||
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -126,7 +128,7 @@ if ($object->id)
|
|||||||
dol_fiche_head($head, 'photos', $title, -1, 'category');
|
dol_fiche_head($head, 'photos', $title, -1, 'category');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
$object->next_prev_filter = ' type = ' . $object->type;
|
||||||
$object->ref = $object->label;
|
$object->ref = $object->label;
|
||||||
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
@ -136,7 +138,7 @@ if ($object->id)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de photo
|
* Confirmation de la suppression de photo
|
||||||
|
|||||||
@ -36,18 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
$langs->loadLangs(array('categories', 'languages'));
|
$langs->loadLangs(array('categories', 'languages'));
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$type = GETPOST('type', 'aZ09');
|
$type = GETPOST('type', 'aZ09');
|
||||||
|
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if ($id == '' && $label == '')
|
||||||
|
|
||||||
// Security check
|
|
||||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
|
||||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
|
||||||
|
|
||||||
if ($id == "")
|
|
||||||
{
|
{
|
||||||
dol_print_error('', 'Missing parameter id');
|
dol_print_error('', 'Missing parameter id');
|
||||||
exit();
|
exit();
|
||||||
@ -57,7 +51,16 @@ if ($id == "")
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
|
$result = $object->fetch($id, $label, $type);
|
||||||
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db, $object->error); exit;
|
||||||
|
}
|
||||||
|
$object->fetch_optionals();
|
||||||
|
if ($result <= 0) {
|
||||||
|
dol_print_error($db, $object->error); exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -159,8 +162,6 @@ $cancel != $langs->trans("Cancel") &&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $object->fetch($id, $ref);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -197,7 +198,7 @@ if (!empty($object->multilangs))
|
|||||||
dol_fiche_head($head, 'translation', $title, -1, 'category');
|
dol_fiche_head($head, 'translation', $title, -1, 'category');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
$object->next_prev_filter = ' type = ' . $object->type;
|
||||||
$object->ref = $object->label;
|
$object->ref = $object->label;
|
||||||
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
$morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
@ -207,7 +208,7 @@ foreach ($ways as $way)
|
|||||||
}
|
}
|
||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,7 +72,7 @@ if ($id == "" && $label == "")
|
|||||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result = $object->fetch($id, $label);
|
$result = $object->fetch($id, $label, $type);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $object->error); exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
@ -80,7 +81,6 @@ if ($result <= 0) {
|
|||||||
dol_print_error($db, $object->error); exit;
|
dol_print_error($db, $object->error); exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $object->type;
|
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
@ -222,8 +222,8 @@ $head = categories_prepare_head($object, $type);
|
|||||||
|
|
||||||
dol_fiche_head($head, 'card', $title, -1, 'category');
|
dol_fiche_head($head, 'card', $title, -1, 'category');
|
||||||
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
$backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
|
||||||
$linkback = '<a href="'.$backtolist.'\">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" type = ".$object->type;
|
$object->next_prev_filter = ' type = ' . $object->type;
|
||||||
$object->ref = $object->label;
|
$object->ref = $object->label;
|
||||||
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
|
||||||
$ways = $object->print_all_ways(" >> ", '', 1);
|
$ways = $object->print_all_ways(" >> ", '', 1);
|
||||||
@ -233,7 +233,7 @@ foreach ($ways as $way)
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1);
|
dol_banner_tab($object, 'label', $linkback, ($user->socid?0:1), 'label', 'label', $morehtmlref, '&type=' . $type, 0, '', '', 1);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -291,8 +291,18 @@ if ($user->rights->categorie->supprimer)
|
|||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
|
if (! empty($user->rights->categorie->creer))
|
||||||
|
{
|
||||||
|
$link = DOL_URL_ROOT.'/categories/card.php';
|
||||||
|
$link .= '?action=create';
|
||||||
|
$link .= '&type='.$type;
|
||||||
|
$link .= '&catorigin='.$object->id;
|
||||||
|
$link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id);
|
||||||
|
|
||||||
|
print '<div class="right">';
|
||||||
|
print dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link);
|
||||||
|
print "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
$cats = $object->get_filles();
|
$cats = $object->get_filles();
|
||||||
if ($cats < 0)
|
if ($cats < 0)
|
||||||
|
|||||||
@ -248,7 +248,7 @@ $nav .= " (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day="
|
|||||||
$picto = 'calendarweek';
|
$picto = 'calendarweek';
|
||||||
|
|
||||||
$nav .= ' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
$nav .= ' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||||
$nav .= '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
$nav .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$nav .= '<input type="hidden" name="action" value="'.$action.'">';
|
$nav .= '<input type="hidden" name="action" value="'.$action.'">';
|
||||||
$nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
|
$nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||||
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||||
|
|||||||
@ -289,7 +289,7 @@ $nav .= " <a href=\"?year=".$next_year."&month=".$next_month."&da
|
|||||||
$nav .= " (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
$nav .= " (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||||
|
|
||||||
/*$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
/*$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||||
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
$nav.='<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
$nav.='<input type="hidden" name="action" value="' . $action . '">';
|
$nav.='<input type="hidden" name="action" value="' . $action . '">';
|
||||||
$nav.='<input type="hidden" name="filtert" value="' . $filtert . '">';
|
$nav.='<input type="hidden" name="filtert" value="' . $filtert . '">';
|
||||||
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
|
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
|
||||||
|
|||||||
@ -992,7 +992,7 @@ else
|
|||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer)
|
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer)
|
||||||
{
|
{
|
||||||
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING))
|
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -726,7 +726,7 @@ if (empty($reshook))
|
|||||||
$originLine = new $lineClassName($db);
|
$originLine = new $lineClassName($db);
|
||||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||||
{
|
{
|
||||||
$originLine->fetch_optionals($lineId);
|
$originLine->fetch_optionals();
|
||||||
$desc = $originLine->desc;
|
$desc = $originLine->desc;
|
||||||
$pu_ht = $originLine->subprice;
|
$pu_ht = $originLine->subprice;
|
||||||
$qty = $originLine->qty;
|
$qty = $originLine->qty;
|
||||||
@ -1523,7 +1523,7 @@ if ($action == 'create')
|
|||||||
$dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice);
|
$dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice);
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
@ -1541,7 +1541,7 @@ if ($action == 'create')
|
|||||||
$object = new Propal($db);
|
$object = new Propal($db);
|
||||||
|
|
||||||
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
if ($origin != 'project' && $originid) {
|
if ($origin != 'project' && $originid) {
|
||||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||||
@ -1675,7 +1675,7 @@ if ($action == 'create')
|
|||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Project").'</td><td>';
|
print '<td>'.$langs->trans("Project").'</td><td>';
|
||||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -2052,7 +2052,7 @@ if ($action == 'create')
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
||||||
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate">';
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
|
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
@ -2078,7 +2078,7 @@ if ($action == 'create')
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
||||||
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setecheance">';
|
print '<input type="hidden" name="action" value="setecheance">';
|
||||||
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
|
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
@ -2412,7 +2412,7 @@ if ($action == 'create')
|
|||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
|||||||
@ -302,7 +302,8 @@ if ($resql)
|
|||||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||||
|
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
|
||||||
print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
|
||||||
|
print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -314,7 +315,7 @@ else dol_print_error($db);
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Opened proposals
|
* Open proposals
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
@ -381,9 +382,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
|
|||||||
$companystatic->canvas = $obj->canvas;
|
$companystatic->canvas = $obj->canvas;
|
||||||
print '<td class="left">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'."\n";
|
print '<td class="left">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'."\n";
|
||||||
|
|
||||||
print '<td class="right">';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
||||||
print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
|
|
||||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||||
|
|
||||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
|
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes')
|
||||||
{
|
{
|
||||||
//if ($user->rights->societe->creer)
|
//if ($user->rights->societe->creer)
|
||||||
//if ($user->rights->facture->creer)
|
//if ($user->rights->facture->creer)
|
||||||
@ -122,6 +122,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
|||||||
$newdiscount2->datec = $discount->datec;
|
$newdiscount2->datec = $discount->datec;
|
||||||
$newdiscount1->tva_tx = $discount->tva_tx;
|
$newdiscount1->tva_tx = $discount->tva_tx;
|
||||||
$newdiscount2->tva_tx = $discount->tva_tx;
|
$newdiscount2->tva_tx = $discount->tva_tx;
|
||||||
|
$newdiscount1->vat_src_code = $discount->vat_src_code;
|
||||||
|
$newdiscount2->vat_src_code = $discount->vat_src_code;
|
||||||
$newdiscount1->amount_ttc = $amount_ttc_1;
|
$newdiscount1->amount_ttc = $amount_ttc_1;
|
||||||
$newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc);
|
$newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc);
|
||||||
$newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
|
$newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
|
||||||
@ -129,6 +131,13 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
|||||||
$newdiscount1->amount_tva = price2num($newdiscount1->amount_ttc - $newdiscount1->amount_ht);
|
$newdiscount1->amount_tva = price2num($newdiscount1->amount_ttc - $newdiscount1->amount_ht);
|
||||||
$newdiscount2->amount_tva = price2num($newdiscount2->amount_ttc - $newdiscount2->amount_ht);
|
$newdiscount2->amount_tva = price2num($newdiscount2->amount_ttc - $newdiscount2->amount_ht);
|
||||||
|
|
||||||
|
$newdiscount1->multicurrency_amount_ttc = $amount_ttc_1 * ($discount->multicurrency_amount_ttc / $discount->amount_ttc);
|
||||||
|
$newdiscount2->multicurrency_amount_ttc = price2num($discount->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ttc);
|
||||||
|
$newdiscount1->multicurrency_amount_ht = price2num($newdiscount1->multicurrency_amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
|
||||||
|
$newdiscount2->multicurrency_amount_ht = price2num($newdiscount2->multicurrency_amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT');
|
||||||
|
$newdiscount1->multicurrency_amount_tva = price2num($newdiscount1->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ht);
|
||||||
|
$newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht);
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
|
$discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
|
||||||
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
|
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
|
||||||
@ -154,12 +163,12 @@ if ($action == 'setremise' && $user->rights->societe->creer)
|
|||||||
//if ($user->rights->societe->creer)
|
//if ($user->rights->societe->creer)
|
||||||
//if ($user->rights->facture->creer)
|
//if ($user->rights->facture->creer)
|
||||||
|
|
||||||
$amount_ht = GETPOST('amount_ht');
|
$amount_ht = price2num(GETPOST('amount_ht', 'alpha'));
|
||||||
$desc = GETPOST('desc', 'alpha');
|
$desc = GETPOST('desc', 'alpha');
|
||||||
$tva_tx = GETPOST('tva_tx', 'alpha');
|
$tva_tx = GETPOST('tva_tx', 'alpha');
|
||||||
$discount_type = !empty($_POST['discount_type']) ?GETPOST('discount_type', 'alpha') : 0;
|
$discount_type = !empty($_POST['discount_type']) ?GETPOST('discount_type', 'alpha') : 0;
|
||||||
|
|
||||||
if (price2num($amount_ht) > 0)
|
if ($amount_ht > 0)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
if (empty($desc))
|
if (empty($desc))
|
||||||
@ -196,7 +205,7 @@ if ($action == 'setremise' && $user->rights->societe->creer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("NewGlobalDiscount")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("AmountHT")), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,10 +384,10 @@ if ($socid > 0)
|
|||||||
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("VAT").'</td>';
|
print '<tr><td>'.$langs->trans("VAT").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->load_tva('tva_tx', GETPOST('tva_tx'), $mysoc, $object);
|
print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0, $mysoc, $object, 0, 0, '', 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
|
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
|
||||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'none').'"></td></tr>';
|
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'alphanohtml').'"></td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@ -409,7 +418,7 @@ if ($socid > 0)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
|
* List not consumed available credits (= linked to no invoice and no invoice line)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
|
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
|
||||||
@ -421,7 +430,8 @@ if ($socid > 0)
|
|||||||
print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
|
print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$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 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
|
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||||
$sql .= " rc.datec as dc, rc.description,";
|
$sql .= " rc.datec as dc, rc.description,";
|
||||||
$sql .= " rc.fk_facture_source,";
|
$sql .= " rc.fk_facture_source,";
|
||||||
$sql .= " u.login, u.rowid as user_id,";
|
$sql .= " u.login, u.rowid as user_id,";
|
||||||
@ -510,7 +520,7 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
@ -577,7 +587,8 @@ if ($socid > 0)
|
|||||||
/*
|
/*
|
||||||
* Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture)
|
* Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture)
|
||||||
*/
|
*/
|
||||||
$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 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
|
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||||
$sql .= " rc.datec as dc, rc.description,";
|
$sql .= " rc.datec as dc, rc.description,";
|
||||||
$sql .= " rc.fk_invoice_supplier_source,";
|
$sql .= " rc.fk_invoice_supplier_source,";
|
||||||
$sql .= " u.login, u.rowid as user_id,";
|
$sql .= " u.login, u.rowid as user_id,";
|
||||||
@ -666,7 +677,7 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
@ -744,7 +755,8 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Discount linked to invoice lines
|
// 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 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
|
$sql .= " 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_source,";
|
$sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,";
|
||||||
$sql .= " u.login, u.rowid as user_id,";
|
$sql .= " u.login, u.rowid as user_id,";
|
||||||
$sql .= " f.rowid as invoiceid, f.ref,";
|
$sql .= " f.rowid as invoiceid, f.ref,";
|
||||||
@ -762,7 +774,7 @@ if ($socid > 0)
|
|||||||
$sql .= " ORDER BY dc DESC";
|
$sql .= " ORDER BY dc DESC";
|
||||||
//$sql.= " UNION ";
|
//$sql.= " UNION ";
|
||||||
// Discount linked to invoices
|
// Discount linked to invoices
|
||||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||||
$sql2 .= " rc.fk_facture_source,";
|
$sql2 .= " rc.fk_facture_source,";
|
||||||
$sql2 .= " u.login, u.rowid as user_id,";
|
$sql2 .= " u.login, u.rowid as user_id,";
|
||||||
@ -881,7 +893,7 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
@ -920,7 +932,8 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Discount linked to invoice lines
|
// 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 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
|
$sql .= " 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.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||||
$sql .= " rc.fk_invoice_supplier_source,";
|
$sql .= " rc.fk_invoice_supplier_source,";
|
||||||
$sql .= " u.login, u.rowid as user_id,";
|
$sql .= " u.login, u.rowid as user_id,";
|
||||||
@ -939,7 +952,7 @@ if ($socid > 0)
|
|||||||
$sql .= " ORDER BY dc DESC";
|
$sql .= " ORDER BY dc DESC";
|
||||||
//$sql.= " UNION ";
|
//$sql.= " UNION ";
|
||||||
// Discount linked to invoices
|
// Discount linked to invoices
|
||||||
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
|
||||||
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||||
$sql2 .= " rc.fk_invoice_supplier_source,";
|
$sql2 .= " rc.fk_invoice_supplier_source,";
|
||||||
$sql2 .= " u.login, u.rowid as user_id,";
|
$sql2 .= " u.login, u.rowid as user_id,";
|
||||||
@ -1057,7 +1070,7 @@ if ($socid > 0)
|
|||||||
{
|
{
|
||||||
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
print '<td class="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.vatrate($obj->tva_tx, true).'</td>';
|
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -385,7 +385,7 @@ if (empty($reshook))
|
|||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,7 +1362,7 @@ if (empty($reshook))
|
|||||||
$originLine = new $lineClassName($db);
|
$originLine = new $lineClassName($db);
|
||||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||||
{
|
{
|
||||||
$originLine->fetch_optionals($lineId);
|
$originLine->fetch_optionals();
|
||||||
$desc = $originLine->desc;
|
$desc = $originLine->desc;
|
||||||
$pu_ht = $originLine->subprice;
|
$pu_ht = $originLine->subprice;
|
||||||
$qty = $originLine->qty;
|
$qty = $originLine->qty;
|
||||||
@ -1549,7 +1549,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
|
|
||||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||||
@ -1602,7 +1602,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
|
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
|
||||||
@ -1741,7 +1741,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Project").'</td><td>';
|
print '<td>'.$langs->trans("Project").'</td><td>';
|
||||||
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0);
|
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -2107,7 +2107,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref .= '</form>';
|
$morehtmlref .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
@ -2184,7 +2184,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editdate') {
|
if ($action == 'editdate') {
|
||||||
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate">';
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
|
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
@ -2205,7 +2205,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editdate_livraison') {
|
if ($action == 'editdate_livraison') {
|
||||||
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||||
print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
|
print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
@ -2499,7 +2499,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">';
|
<input type="hidden" name="id" value="' . $object->id.'">';
|
||||||
|
|||||||
@ -1381,7 +1381,7 @@ class Commande extends CommonOrder
|
|||||||
$this->origin_id = $object->id;
|
$this->origin_id = $object->id;
|
||||||
|
|
||||||
// get extrafields from original line
|
// get extrafields from original line
|
||||||
$object->fetch_optionals($object->id);
|
$object->fetch_optionals();
|
||||||
|
|
||||||
$e = new ExtraFields($this->db);
|
$e = new ExtraFields($this->db);
|
||||||
$element_extrafields = $e->fetch_name_optionals_label($this->table_element);
|
$element_extrafields = $e->fetch_name_optionals_label($this->table_element);
|
||||||
@ -3613,7 +3613,7 @@ class Commande extends CommonOrder
|
|||||||
if ($status == self::STATUS_CANCELED) {
|
if ($status == self::STATUS_CANCELED) {
|
||||||
$labelStatus = $langs->trans('StatusOrderCanceled');
|
$labelStatus = $langs->trans('StatusOrderCanceled');
|
||||||
$labelStatusShort = $langs->trans('StatusOrderCanceledShort');
|
$labelStatusShort = $langs->trans('StatusOrderCanceledShort');
|
||||||
$statusType = 'status5';
|
$statusType = 'status9';
|
||||||
}
|
}
|
||||||
elseif ($status == self::STATUS_DRAFT) {
|
elseif ($status == self::STATUS_DRAFT) {
|
||||||
$labelStatus = $langs->trans('StatusOrderDraft');
|
$labelStatus = $langs->trans('StatusOrderDraft');
|
||||||
@ -3628,7 +3628,7 @@ class Commande extends CommonOrder
|
|||||||
elseif ($status == self::STATUS_SHIPMENTONPROCESS) {
|
elseif ($status == self::STATUS_SHIPMENTONPROCESS) {
|
||||||
$labelStatus = $langs->trans('StatusOrderSentShort').$billedtext;
|
$labelStatus = $langs->trans('StatusOrderSentShort').$billedtext;
|
||||||
$labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext;
|
$labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext;
|
||||||
$statusType = 'status3';
|
$statusType = 'status4';
|
||||||
}
|
}
|
||||||
elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
|
||||||
$labelStatus = $langs->trans('StatusOrderToBill');
|
$labelStatus = $langs->trans('StatusOrderToBill');
|
||||||
|
|||||||
@ -72,7 +72,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
{
|
{
|
||||||
// Search customer orders
|
// Search customer orders
|
||||||
$var = false;
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -88,7 +87,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
* Statistics
|
* Statistics
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT count(c.rowid), c.fk_statut";
|
$sql = "SELECT count(c.rowid) as nb, c.fk_statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -117,7 +116,7 @@ if ($resql)
|
|||||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||||
{
|
{
|
||||||
if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
|
if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
|
||||||
$vals[$row[1].$bool]+=$row[0];
|
$vals[$row[1]]+=$row[0];
|
||||||
$totalinprocess+=$row[0];
|
$totalinprocess+=$row[0];
|
||||||
}
|
}
|
||||||
$total+=$row[0];
|
$total+=$row[0];
|
||||||
@ -125,13 +124,32 @@ if ($resql)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
|
||||||
$listofstatus=array(0,1,2,3,-1);
|
$listofstatus=array(0,1,2,3,-1);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array($commandestatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
$dataseries[] = array($commandestatic->LibStatut($status, 0, 1, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
|
if ($status == Commande::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == Commande::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == Commande::STATUS_SHIPMENTONPROCESS) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == Commande::STATUS_CLOSED && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) $colorseries[$status] = $badgeStatus6;
|
||||||
|
if ($status == Commande::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) $colorseries[$status] = $badgeStatus6;
|
||||||
|
if ($status == Commande::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
|
||||||
|
if (empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$commandestatic->LibStatut($status, 0, 0, 1).'</td>';
|
||||||
|
print '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).' ';
|
||||||
|
print $commandestatic->LibStatut($status, 0, 3, 1);
|
||||||
|
print '</a></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -140,6 +158,7 @@ if ($resql)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
@ -149,19 +168,6 @@ if ($resql)
|
|||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach ($listofstatus as $status)
|
|
||||||
{
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td>'.$commandestatic->LibStatut($status, $bool, 0).'</td>';
|
|
||||||
print '<td class="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool]) ? $vals[$status.$bool] : 0).' ';
|
|
||||||
print $commandestatic->LibStatut($status, $bool, 3);
|
|
||||||
print '</a>';
|
|
||||||
print '</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if ($totalinprocess != $total)
|
//if ($totalinprocess != $total)
|
||||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
|
||||||
print "</table></div><br>";
|
print "</table></div><br>";
|
||||||
@ -202,7 +208,6 @@ if (!empty($conf->commande->enabled))
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = true;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -241,7 +246,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
$max = 5;
|
$max = 5;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last modified orders
|
* Lattest modified orders
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
|
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
|
||||||
@ -272,7 +277,6 @@ if ($resql)
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = true;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -311,7 +315,7 @@ if ($resql)
|
|||||||
print $companystatic->getNomUrl(1, 'company', 16);
|
print $companystatic->getNomUrl(1, 'company', 16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -320,13 +324,14 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
$max = 10;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Orders to process
|
* Orders to process
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->commande->enabled))
|
if (!empty($conf->commande->enabled))
|
||||||
{
|
{
|
||||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
|
||||||
$sql .= ", s.client";
|
$sql .= ", s.client";
|
||||||
$sql .= ", s.code_client";
|
$sql .= ", s.code_client";
|
||||||
$sql .= ", s.canvas";
|
$sql .= ", s.canvas";
|
||||||
@ -335,7 +340,7 @@ if (!empty($conf->commande->enabled))
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||||
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
||||||
$sql .= " AND c.fk_statut = 1";
|
$sql .= " AND c.fk_statut = ".Commande::STATUS_VALIDATED;
|
||||||
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
$sql .= " ORDER BY c.rowid DESC";
|
$sql .= " ORDER BY c.rowid DESC";
|
||||||
@ -344,16 +349,16 @@ if (!empty($conf->commande->enabled))
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></th></tr>';
|
print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = true;
|
while ($i < $num && $i < $max)
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -390,11 +395,16 @@ if (!empty($conf->commande->enabled))
|
|||||||
print $companystatic->getNomUrl(1, 'company', 24);
|
print $companystatic->getNomUrl(1, 'company', 24);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
|
||||||
|
|
||||||
|
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if ($i < $num) {
|
||||||
|
print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table></div><br>";
|
print "</table></div><br>";
|
||||||
@ -403,11 +413,11 @@ if (!empty($conf->commande->enabled))
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Orders thar are in a shipping process
|
* Orders that are in process
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->commande->enabled))
|
if (!empty($conf->commande->enabled))
|
||||||
{
|
{
|
||||||
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
|
||||||
$sql .= ", s.client";
|
$sql .= ", s.client";
|
||||||
$sql .= ", s.code_client";
|
$sql .= ", s.code_client";
|
||||||
$sql .= ", s.canvas";
|
$sql .= ", s.canvas";
|
||||||
@ -416,7 +426,7 @@ if (!empty($conf->commande->enabled))
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||||
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
$sql .= " AND c.entity IN (".getEntity('commande').")";
|
||||||
$sql .= " AND c.fk_statut = 2 ";
|
$sql .= " AND c.fk_statut = ".Commande::STATUS_ACCEPTED;
|
||||||
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql .= " AND c.fk_soc = ".$socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
$sql .= " ORDER BY c.rowid DESC";
|
$sql .= " ORDER BY c.rowid DESC";
|
||||||
@ -429,13 +439,12 @@ if (!empty($conf->commande->enabled))
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></th></tr>';
|
print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = true;
|
while ($i < $num && $i < $max)
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -472,11 +481,16 @@ if (!empty($conf->commande->enabled))
|
|||||||
print $companystatic->getNomUrl(1, 'company');
|
print $companystatic->getNomUrl(1, 'company');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
|
||||||
|
|
||||||
|
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if ($i < $num) {
|
||||||
|
print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "</table></div><br>";
|
print "</table></div><br>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -287,7 +287,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -363,7 +363,7 @@ if ($action == "create" || $action == "start" || $action == 'close')
|
|||||||
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@ -680,7 +680,7 @@ if (empty($action) || $action == "view" || $action == "close")
|
|||||||
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
print '<center><iframe src="report.php?id='.$id.'" width="60%" height="800"></iframe></center>';
|
||||||
} else {
|
} else {
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formclose">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formclose">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|||||||
@ -1680,7 +1680,7 @@ else
|
|||||||
|
|
||||||
// Lines
|
// Lines
|
||||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid')).'" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
@ -302,10 +302,12 @@ if (empty($reshook))
|
|||||||
$array_of_total_ht_per_vat_rate = array();
|
$array_of_total_ht_per_vat_rate = array();
|
||||||
$array_of_total_ht_devise_per_vat_rate = array();
|
$array_of_total_ht_devise_per_vat_rate = array();
|
||||||
foreach ($object->lines as $line) {
|
foreach ($object->lines as $line) {
|
||||||
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
//$vat_src_code_for_line = $line->vat_src_code; // TODO We chek sign of total per vat without taking into account the vat code because for the moment the vat code is lost/unknown when we add a down payment.
|
||||||
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
$vat_src_code_for_line = '';
|
||||||
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->total_ht;
|
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
|
||||||
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_total_ht;
|
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
|
||||||
|
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->total_ht;
|
||||||
|
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->multicurrency_total_ht;
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($array_of_total_ht_per_vat_rate);exit;
|
//var_dump($array_of_total_ht_per_vat_rate);exit;
|
||||||
@ -485,10 +487,10 @@ if (empty($reshook))
|
|||||||
// POST[remise_id] or POST[remise_id_for_payment]
|
// POST[remise_id] or POST[remise_id_for_payment]
|
||||||
|
|
||||||
// We use the credit to reduce amount of invoice
|
// We use the credit to reduce amount of invoice
|
||||||
if (!empty($_POST["remise_id"])) {
|
if (GETPOST("remise_id", 'int') > 0) {
|
||||||
$ret = $object->fetch($id);
|
$ret = $object->fetch($id);
|
||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
$result = $object->insert_discount($_POST["remise_id"]);
|
$result = $object->insert_discount(GETPOST("remise_id", 'int'));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
@ -497,11 +499,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We use the credit to reduce remain to pay
|
// We use the credit to reduce remain to pay
|
||||||
if (!empty($_POST["remise_id_for_payment"]))
|
if (GETPOST("remise_id_for_payment", 'int') > 0)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||||
$discount = new DiscountAbsolute($db);
|
$discount = new DiscountAbsolute($db);
|
||||||
$discount->fetch($_POST["remise_id_for_payment"]);
|
$discount->fetch(GETPOST("remise_id_for_payment", 'int'));
|
||||||
|
|
||||||
//var_dump($object->getRemainToPay(0));
|
//var_dump($object->getRemainToPay(0));
|
||||||
//var_dump($discount->amount_ttc);exit;
|
//var_dump($discount->amount_ttc);exit;
|
||||||
@ -809,14 +811,16 @@ if (empty($reshook))
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
|
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 and no need to create discount if amount is null
|
||||||
{ // no need to create discount if amount is null
|
{
|
||||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
$keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : '');
|
||||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
|
||||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
$amount_ht[$keyforvatrate] += $line->total_ht;
|
||||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
$amount_tva[$keyforvatrate] += $line->total_tva;
|
||||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
$amount_ttc[$keyforvatrate] += $line->total_ttc;
|
||||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
$multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht;
|
||||||
|
$multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva;
|
||||||
|
$multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -830,9 +834,9 @@ if (empty($reshook))
|
|||||||
$amount_ht[$vatrate] = price2num($amount_ht[$vatrate] * $ratio, 'MU');
|
$amount_ht[$vatrate] = price2num($amount_ht[$vatrate] * $ratio, 'MU');
|
||||||
$amount_tva[$vatrate] = price2num($amount_tva[$vatrate] * $ratio, 'MU');
|
$amount_tva[$vatrate] = price2num($amount_tva[$vatrate] * $ratio, 'MU');
|
||||||
$amount_ttc[$vatrate] = price2num($amount_ttc[$vatrate] * $ratio, 'MU');
|
$amount_ttc[$vatrate] = price2num($amount_ttc[$vatrate] * $ratio, 'MU');
|
||||||
$multicurrency_amount_ht[$line->tva_tx] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
|
$multicurrency_amount_ht[$vatrate] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
|
||||||
$multicurrency_amount_tva[$line->tva_tx] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
|
$multicurrency_amount_tva[$vatrate] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
|
||||||
$multicurrency_amount_ttc[$line->tva_tx] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
|
$multicurrency_amount_ttc[$vatrate] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -887,6 +891,7 @@ if (empty($reshook))
|
|||||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||||
$discount->amount_tva = 0;
|
$discount->amount_tva = 0;
|
||||||
$discount->tva_tx = 0;
|
$discount->tva_tx = 0;
|
||||||
|
$discount->vat_src_code = '';
|
||||||
|
|
||||||
$result = $discount->create($user);
|
$result = $discount->create($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -904,7 +909,18 @@ if (empty($reshook))
|
|||||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||||
|
|
||||||
|
// Clean vat code
|
||||||
|
$reg = array();
|
||||||
|
$vat_src_code = '';
|
||||||
|
if (preg_match('/\((.*)\)/', $tva_tx, $reg))
|
||||||
|
{
|
||||||
|
$vat_src_code = $reg[1];
|
||||||
|
$tva_tx = preg_replace('/\s*\(.*\)/', '', $tva_tx); // Remove code into vatrate.
|
||||||
|
}
|
||||||
|
|
||||||
$discount->tva_tx = abs($tva_tx);
|
$discount->tva_tx = abs($tva_tx);
|
||||||
|
$discount->vat_src_code =$vat_src_code;
|
||||||
|
|
||||||
$result = $discount->create($user);
|
$result = $discount->create($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -1592,7 +1608,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1733,7 +1749,7 @@ if (empty($reshook))
|
|||||||
$line->origin = $object->origin;
|
$line->origin = $object->origin;
|
||||||
$line->origin_id = $line->id;
|
$line->origin_id = $line->id;
|
||||||
$line->fk_prev_id = $line->id;
|
$line->fk_prev_id = $line->id;
|
||||||
$line->fetch_optionals($line->id);
|
$line->fetch_optionals();
|
||||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||||
|
|
||||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||||
@ -2539,7 +2555,7 @@ if (empty($reshook))
|
|||||||
$originLine = new $lineClassName($db);
|
$originLine = new $lineClassName($db);
|
||||||
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0)
|
||||||
{
|
{
|
||||||
$originLine->fetch_optionals($lineId);
|
$originLine->fetch_optionals();
|
||||||
$desc = $originLine->desc;
|
$desc = $originLine->desc;
|
||||||
$pu_ht = $originLine->subprice;
|
$pu_ht = $originLine->subprice;
|
||||||
$qty = $originLine->qty;
|
$qty = $originLine->qty;
|
||||||
@ -2794,7 +2810,7 @@ if ($action == 'create')
|
|||||||
$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
|
$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
|
||||||
|
|
||||||
//Replicate extrafields
|
//Replicate extrafields
|
||||||
$expesrc->fetch_optionals($expeoriginid);
|
$expesrc->fetch_optionals();
|
||||||
$object->array_options = $expesrc->array_options;
|
$object->array_options = $expesrc->array_options;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2812,7 +2828,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2854,7 +2870,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
if ($soc->id > 0) print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
if ($soc->id > 0) print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
|
||||||
print '<input name="ref" type="hidden" value="provisoire">';
|
print '<input name="ref" type="hidden" value="provisoire">';
|
||||||
@ -3397,7 +3413,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||||
$numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
$numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -4459,7 +4475,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'editrevenuestamp') {
|
if ($action == 'editrevenuestamp') {
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setrevenuestamp">';
|
print '<input type="hidden" name="action" value="setrevenuestamp">';
|
||||||
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
|
||||||
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
|
||||||
@ -4963,7 +4979,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
|
|||||||
@ -677,7 +677,7 @@ class FactureRec extends CommonInvoice
|
|||||||
$line->price = $objp->price;
|
$line->price = $objp->price;
|
||||||
$line->remise = $objp->remise;
|
$line->remise = $objp->remise;
|
||||||
|
|
||||||
$line->fetch_optionals($line->id);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$line->fk_multicurrency = $objp->fk_multicurrency;
|
$line->fk_multicurrency = $objp->fk_multicurrency;
|
||||||
|
|||||||
@ -1317,7 +1317,7 @@ class Facture extends CommonInvoice
|
|||||||
$this->origin_id = $object->id;
|
$this->origin_id = $object->id;
|
||||||
|
|
||||||
// get extrafields from original line
|
// get extrafields from original line
|
||||||
$object->fetch_optionals($object->id);
|
$object->fetch_optionals();
|
||||||
foreach ($object->array_options as $options_key => $value)
|
foreach ($object->array_options as $options_key => $value)
|
||||||
$this->array_options[$options_key] = $value;
|
$this->array_options[$options_key] = $value;
|
||||||
|
|
||||||
@ -1652,8 +1652,8 @@ class Facture extends CommonInvoice
|
|||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
$sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,';
|
$sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,';
|
||||||
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
|
||||||
$sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
|
$sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
|
||||||
|
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
||||||
$sql .= ' l.rang, l.special_code,';
|
$sql .= ' l.rang, l.special_code,';
|
||||||
$sql .= ' l.date_start as date_start, l.date_end as date_end,';
|
$sql .= ' l.date_start as date_start, l.date_end as date_end,';
|
||||||
$sql .= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,';
|
$sql .= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,';
|
||||||
@ -3076,6 +3076,7 @@ class Facture extends CommonInvoice
|
|||||||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||||
|
|
||||||
// Clean vat code
|
// Clean vat code
|
||||||
|
$reg = array();
|
||||||
$vat_src_code = '';
|
$vat_src_code = '';
|
||||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -348,7 +348,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
$sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||||
$sql .= " s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
|
$sql .= " s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
|
||||||
$sql .= " cc.rowid, cc.code";
|
$sql .= " cc.rowid, cc.code";
|
||||||
$sql .= " ORDER BY f.tms DESC ";
|
$sql .= " ORDER BY f.tms DESC";
|
||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -317,7 +317,7 @@ if (empty($reshook))
|
|||||||
$array_options = array();
|
$array_options = array();
|
||||||
// For avoid conflicts if trigger used
|
// For avoid conflicts if trigger used
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1128,12 +1128,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$classname = ucfirst($subelement);
|
$classname = ucfirst($subelement);
|
||||||
$objectsrc = new $classname($db);
|
$objectsrc = new $classname($db);
|
||||||
$objectsrc->fetch(GETPOST('originid'));
|
$objectsrc->fetch($originid);
|
||||||
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) $objectsrc->fetch_lines();
|
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) $objectsrc->fetch_lines();
|
||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
|
|
||||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||||
@ -1703,7 +1703,8 @@ else
|
|||||||
// Display lines extrafields
|
// Display lines extrafields
|
||||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||||
$line = new ContratLigne($db);
|
$line = new ContratLigne($db);
|
||||||
$line->fetch_optionals($objp->rowid);
|
$line->id = $objp->rowid;
|
||||||
|
$line->fetch_optionals();
|
||||||
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1793,7 +1794,8 @@ else
|
|||||||
|
|
||||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||||
$line = new ContratLigne($db);
|
$line = new ContratLigne($db);
|
||||||
$line->fetch_optionals($objp->rowid);
|
$line->id = $objp->rowid;
|
||||||
|
$line->fetch_optionals();
|
||||||
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2785,7 +2785,7 @@ class ContratLigne extends CommonObjectLine
|
|||||||
elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); }
|
elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); }
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status3';
|
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status1';
|
||||||
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
|
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
|
||||||
|
|
||||||
$params = array(); $reg = array();
|
$params = array(); $reg = array();
|
||||||
|
|||||||
@ -109,7 +109,7 @@ $dataseries = array();
|
|||||||
$vals = array();
|
$vals = array();
|
||||||
|
|
||||||
// Search by status (except expired)
|
// Search by status (except expired)
|
||||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -126,16 +126,16 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$nb[$row[1]] = $row[0];
|
$nb[$obj->status] = $obj->nb;
|
||||||
if ($row[1] != 5)
|
if ($obj->status != 5)
|
||||||
{
|
{
|
||||||
$vals[$row[1]] = $row[0];
|
$vals[$obj->status] = $obj->nb;
|
||||||
$totalinprocess += $row[0];
|
$totalinprocess += $obj->nb;
|
||||||
}
|
}
|
||||||
$total += $row[0];
|
$total += $obj->nb;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
// Search by status (only expired)
|
// Search by status (only expired)
|
||||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -165,16 +165,16 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$nb[$row[1].true] = $row[0];
|
$nb[$obj->status.true] = $obj->nb;
|
||||||
if ($row[1] != 5)
|
if ($obj->status != 5)
|
||||||
{
|
{
|
||||||
$vals[$row[1]] = $row[0];
|
$vals[$obj->status.true] = $obj->nb;
|
||||||
$totalinprocess += $row[0];
|
$totalinprocess += $obj->nb;
|
||||||
}
|
}
|
||||||
$total += $row[0];
|
$total += $obj->nb;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -185,6 +185,10 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$colorseries = array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</th></tr>'."\n";
|
||||||
@ -192,6 +196,11 @@ $listofstatus = array(0, 4, 4, 5); $bool = false;
|
|||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0));
|
$dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0));
|
||||||
|
if ($status == ContratLigne::STATUS_INITIAL) $colorseries[$status.$bool] = '-'.$badgeStatus0;
|
||||||
|
if ($status == ContratLigne::STATUS_OPEN && !$bool) $colorseries[$status.$bool] = $badgeStatus4;
|
||||||
|
if ($status == ContratLigne::STATUS_OPEN && $bool) $colorseries[$status.$bool] = $badgeStatus1;
|
||||||
|
if ($status == ContratLigne::STATUS_CLOSED) $colorseries[$status.$bool] = $badgeStatus6;
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -209,6 +218,7 @@ if (!empty($conf->use_javascript_ajax))
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
|
|||||||
@ -744,7 +744,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_options = $lines[$i]->array_options;
|
$array_options = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$alreadypaid+=$this->getSumDepositsUsed($multicurrency);
|
$alreadypaid+=$this->getSumDepositsUsed($multicurrency);
|
||||||
$alreadypaid+=$this->getSumCreditNotesUsed($multicurrency);
|
$alreadypaid+=$this->getSumCreditNotesUsed($multicurrency);
|
||||||
|
|
||||||
$remaintopay = ($this->total_ttc - $alreadypaid);
|
$remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT');
|
||||||
if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment
|
if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment
|
||||||
$remaintopay = 0;
|
$remaintopay = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,11 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
public $array_options = array();
|
public $array_options = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Array to store alternative languages values of object
|
||||||
|
*/
|
||||||
|
public $array_languages = null; // Value is array() when load already tried
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked
|
* @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked
|
||||||
*/
|
*/
|
||||||
@ -5041,6 +5046,72 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Functions for data in other language */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to get alternative languages of a data into $this->array_languages
|
||||||
|
* This method is NOT called by method fetch of objects but must be called separately.
|
||||||
|
*
|
||||||
|
* @return int <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded
|
||||||
|
*/
|
||||||
|
public function fetchValueForAlternateLanguages()
|
||||||
|
{
|
||||||
|
// To avoid SQL errors. Probably not the better solution though
|
||||||
|
if (!$this->element) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (! ($this->id > 0)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->array_languages = array();
|
||||||
|
|
||||||
|
$element = $this->element;
|
||||||
|
if ($element == 'categorie') $element = 'categories'; // For compatibility
|
||||||
|
|
||||||
|
// Request to get translation values for object
|
||||||
|
$sql = "SELECT rowid, property, lang , value";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."object_lang";
|
||||||
|
$sql .= " WHERE type_object = '".$element."'";
|
||||||
|
$sql .= " AND fk_object = ".$this->id;
|
||||||
|
|
||||||
|
//dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG); // Too verbose
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$numrows = $this->db->num_rows($resql);
|
||||||
|
if ($numrows)
|
||||||
|
{
|
||||||
|
$tab = $this->db->fetch_array($resql);
|
||||||
|
|
||||||
|
foreach ($tab as $key => $value)
|
||||||
|
{
|
||||||
|
// we can add this attribute to object
|
||||||
|
if (preg_match('/date/', $key))
|
||||||
|
{
|
||||||
|
$this->array_languages[$key] = $this->db->jdate($value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->array_languages[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
if ($numrows) return $numrows;
|
||||||
|
else return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Functions for extrafields */
|
/* Functions for extrafields */
|
||||||
|
|
||||||
|
|
||||||
@ -5059,6 +5130,7 @@ abstract class CommonObject
|
|||||||
global $extrafields;
|
global $extrafields;
|
||||||
|
|
||||||
if (empty($rowid)) $rowid = $this->id;
|
if (empty($rowid)) $rowid = $this->id;
|
||||||
|
if (empty($rowid)) $rowid = $this->rowid;
|
||||||
|
|
||||||
// To avoid SQL errors. Probably not the better solution though
|
// To avoid SQL errors. Probably not the better solution though
|
||||||
if (!$this->table_element) {
|
if (!$this->table_element) {
|
||||||
@ -5110,7 +5182,6 @@ abstract class CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->array_options = array();
|
|
||||||
$numrows = $this->db->num_rows($resql);
|
$numrows = $this->db->num_rows($resql);
|
||||||
if ($numrows)
|
if ($numrows)
|
||||||
{
|
{
|
||||||
@ -6679,9 +6750,10 @@ abstract class CommonObject
|
|||||||
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
|
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
|
||||||
elseif ($mode == 'view' && empty($visibility)) continue;
|
elseif ($mode == 'view' && empty($visibility)) continue;
|
||||||
if (empty($perms)) continue;
|
if (empty($perms)) continue;
|
||||||
|
|
||||||
// Load language if required
|
// Load language if required
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) {
|
||||||
|
$langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
||||||
|
}
|
||||||
|
|
||||||
$colspan = '';
|
$colspan = '';
|
||||||
if (is_array($params) && count($params) > 0) {
|
if (is_array($params) && count($params) > 0) {
|
||||||
@ -6780,8 +6852,8 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key];
|
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
$labeltoshow = $langs->trans($label);
|
$labeltoshow = $langs->trans($label);
|
||||||
|
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);
|
||||||
|
|
||||||
$out .= '<td class="';
|
$out .= '<td class="';
|
||||||
//$out .= "titlefield";
|
//$out .= "titlefield";
|
||||||
@ -6790,14 +6862,13 @@ abstract class CommonObject
|
|||||||
$tpl_context = isset($params["tpl_context"]) ? $params["tpl_context"] : "none";
|
$tpl_context = isset($params["tpl_context"]) ? $params["tpl_context"] : "none";
|
||||||
if ($tpl_context == "public") { // Public page : red dot instead of fieldrequired characters
|
if ($tpl_context == "public") { // Public page : red dot instead of fieldrequired characters
|
||||||
$out .= '">';
|
$out .= '">';
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
|
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow);
|
||||||
else $out .= $labeltoshow;
|
else $out .= $labeltoshow;
|
||||||
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' <font color="red">*</font>';
|
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' <font color="red">*</font>';
|
||||||
} else {
|
} else {
|
||||||
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
|
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
|
||||||
$out .= '"';
|
$out .= '">';
|
||||||
$out .= '>';
|
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow);
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
|
|
||||||
else $out .= $labeltoshow;
|
else $out .= $labeltoshow;
|
||||||
}
|
}
|
||||||
$out .= '</td>';
|
$out .= '</td>';
|
||||||
|
|||||||
@ -62,6 +62,7 @@ class DiscountAbsolute
|
|||||||
public $multicurrency_amount_ttc;
|
public $multicurrency_amount_ttc;
|
||||||
// Vat rate
|
// Vat rate
|
||||||
public $tva_tx;
|
public $tva_tx;
|
||||||
|
public $vat_src_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int User ID Id utilisateur qui accorde la remise
|
* @var int User ID Id utilisateur qui accorde la remise
|
||||||
@ -133,7 +134,7 @@ class DiscountAbsolute
|
|||||||
|
|
||||||
$sql = "SELECT sr.rowid, sr.fk_soc, sr.discount_type,";
|
$sql = "SELECT sr.rowid, sr.fk_soc, sr.discount_type,";
|
||||||
$sql.= " sr.fk_user,";
|
$sql.= " sr.fk_user,";
|
||||||
$sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx,";
|
$sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx, sr.vat_src_code,";
|
||||||
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
|
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
|
||||||
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,";
|
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,";
|
||||||
$sql.= " sr.datec,";
|
$sql.= " sr.datec,";
|
||||||
@ -168,6 +169,8 @@ class DiscountAbsolute
|
|||||||
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
|
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
|
||||||
|
|
||||||
$this->tva_tx = $obj->tva_tx;
|
$this->tva_tx = $obj->tva_tx;
|
||||||
|
$this->vat_src_code = $obj->vat_src_code;
|
||||||
|
|
||||||
$this->fk_user = $obj->fk_user;
|
$this->fk_user = $obj->fk_user;
|
||||||
$this->fk_facture_line = $obj->fk_facture_line;
|
$this->fk_facture_line = $obj->fk_facture_line;
|
||||||
$this->fk_facture = $obj->fk_facture;
|
$this->fk_facture = $obj->fk_facture;
|
||||||
@ -244,12 +247,12 @@ class DiscountAbsolute
|
|||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
||||||
$sql .= " (entity, datec, fk_soc, discount_type, fk_user, description,";
|
$sql .= " (entity, datec, fk_soc, discount_type, fk_user, description,";
|
||||||
$sql .= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
$sql .= " amount_ht, amount_tva, amount_ttc, tva_tx, vat_src_code,";
|
||||||
$sql .= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
|
$sql .= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
|
||||||
$sql .= " fk_facture_source, fk_invoice_supplier_source";
|
$sql .= " fk_facture_source, fk_invoice_supplier_source";
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
$sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec != '' ? $this->datec : dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type) ? 0 : intval($this->discount_type)).", ".$userid.", '".$this->db->escape($this->description)."',";
|
$sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec != '' ? $this->datec : dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type) ? 0 : intval($this->discount_type)).", ".$userid.", '".$this->db->escape($this->description)."',";
|
||||||
$sql .= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
$sql .= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.", '".$this->db->escape($this->vat_src_code)."',";
|
||||||
$sql .= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
|
$sql .= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
|
||||||
$sql .= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'" : "null").",";
|
$sql .= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'" : "null").",";
|
||||||
$sql .= " ".($this->fk_invoice_supplier_source ? "'".$this->db->escape($this->fk_invoice_supplier_source)."'" : "null");
|
$sql .= " ".($this->fk_invoice_supplier_source ? "'".$this->db->escape($this->fk_invoice_supplier_source)."'" : "null");
|
||||||
|
|||||||
@ -392,6 +392,7 @@ class ExtraFields
|
|||||||
if (empty($list)) $list = '0';
|
if (empty($list)) $list = '0';
|
||||||
if (empty($required)) $required = 0;
|
if (empty($required)) $required = 0;
|
||||||
if (empty($unique)) $unique = 0;
|
if (empty($unique)) $unique = 0;
|
||||||
|
if (empty($printable)) $printable = 0;
|
||||||
if (empty($alwayseditable)) $alwayseditable = 0;
|
if (empty($alwayseditable)) $alwayseditable = 0;
|
||||||
if (empty($totalizable)) $totalizable = 0;
|
if (empty($totalizable)) $totalizable = 0;
|
||||||
|
|
||||||
@ -1590,9 +1591,9 @@ class ExtraFields
|
|||||||
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
||||||
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
||||||
*/
|
*/
|
||||||
if (! empty($help) && $keyprefix != 'search_options_') {
|
/*if (! empty($help) && $keyprefix != 'search_options_') {
|
||||||
$out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3);
|
$out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3);
|
||||||
}
|
}*/
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -316,6 +316,56 @@ class Form
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output edit in place form
|
||||||
|
*
|
||||||
|
* @param string $fieldname Name of the field
|
||||||
|
* @param object $object Object
|
||||||
|
* @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
|
||||||
|
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
|
||||||
|
* @param string $check Same coe than $check parameter of GETPOST()
|
||||||
|
* @param string $morecss More CSS
|
||||||
|
* @return string HTML code for the edit of alternative language
|
||||||
|
*/
|
||||||
|
public function widgetForTranslation($fieldname, $object, $perm, $typeofdata = 'string', $check = '', $morecss = '')
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) {
|
||||||
|
$langcode = $conf->global->PDF_USE_ALSO_LANGUAGE_CODE;
|
||||||
|
|
||||||
|
$result .='<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">';
|
||||||
|
$s=img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
|
||||||
|
$result .= $s;
|
||||||
|
$result .= '</div>';
|
||||||
|
|
||||||
|
$result .='<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">';
|
||||||
|
|
||||||
|
$valuetoshow = GETPOSTISSET($fieldname."-".$langcode) ? GETPOST($fieldname."-".$langcode, $check) : '';
|
||||||
|
if (empty($valuetoshow)) {
|
||||||
|
$object->fetchValueForAlternateLanguages();
|
||||||
|
//var_dump($object->array_languages);
|
||||||
|
$valuetoshow = $object->array_languages[$fieldname][$langcode];
|
||||||
|
}
|
||||||
|
|
||||||
|
$s=picto_from_langcode($conf->global->PDF_USE_ALSO_LANGUAGE_CODE, 'class="pictoforlang"');
|
||||||
|
$result .= $s;
|
||||||
|
if ($typeofdata == 'textarea') {
|
||||||
|
$result .= '<textarea name="'.$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
|
||||||
|
$result .= $object->address;
|
||||||
|
$result .= '</textarea>';
|
||||||
|
} else {
|
||||||
|
$result .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="'.$fieldname."-".$langcode.'" value="'.$valuetoshow.'">';
|
||||||
|
}
|
||||||
|
$result .= '</div>';
|
||||||
|
$result .= '<script>$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output edit in place form
|
* Output edit in place form
|
||||||
*
|
*
|
||||||
@ -642,12 +692,14 @@ class Form
|
|||||||
/* console.log( index + ": " + $( this ).text() ); */
|
/* console.log( index + ": " + $( this ).text() ); */
|
||||||
if ($(this).is(\':checked\')) atleastoneselected++;
|
if ($(this).is(\':checked\')) atleastoneselected++;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected);
|
console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected);
|
||||||
|
|
||||||
if (atleastoneselected || '.$alwaysvisible.')
|
if (atleastoneselected || '.$alwaysvisible.')
|
||||||
{
|
{
|
||||||
jQuery(".massaction").show();
|
jQuery(".massaction").show();
|
||||||
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'"); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').'
|
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').'
|
||||||
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0"); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').'
|
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').'
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2114,7 +2166,7 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
|
$selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
|
||||||
if (count($warehouseStatusArray))
|
if (count($warehouseStatusArray))
|
||||||
{
|
{
|
||||||
$selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
|
$selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
|
||||||
@ -2418,6 +2470,7 @@ class Form
|
|||||||
$outlabel = '';
|
$outlabel = '';
|
||||||
$outdesc = '';
|
$outdesc = '';
|
||||||
$outbarcode = '';
|
$outbarcode = '';
|
||||||
|
$outorigin = '';
|
||||||
$outtype = '';
|
$outtype = '';
|
||||||
$outprice_ht = '';
|
$outprice_ht = '';
|
||||||
$outprice_ttc = '';
|
$outprice_ttc = '';
|
||||||
@ -2437,6 +2490,7 @@ class Form
|
|||||||
$outlabel = $objp->label;
|
$outlabel = $objp->label;
|
||||||
$outdesc = $objp->description;
|
$outdesc = $objp->description;
|
||||||
$outbarcode = $objp->barcode;
|
$outbarcode = $objp->barcode;
|
||||||
|
$outorigin = $objp->fk_country;
|
||||||
$outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid;
|
$outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid;
|
||||||
|
|
||||||
$outtype = $objp->fk_product_type;
|
$outtype = $objp->fk_product_type;
|
||||||
@ -2498,12 +2552,15 @@ class Form
|
|||||||
$opt .= $objp->ref;
|
$opt .= $objp->ref;
|
||||||
if ($outbarcode) $opt .= ' ('.$outbarcode.')';
|
if ($outbarcode) $opt .= ' ('.$outbarcode.')';
|
||||||
$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
|
$opt .= ' - '.dol_trunc($label, $maxlengtharticle);
|
||||||
|
if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')';
|
||||||
|
|
||||||
$objRef = $objp->ref;
|
$objRef = $objp->ref;
|
||||||
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
|
||||||
$outval .= $objRef;
|
$outval .= $objRef;
|
||||||
if ($outbarcode) $outval .= ' ('.$outbarcode.')';
|
if ($outbarcode) $outval .= ' ('.$outbarcode.')';
|
||||||
$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
|
$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
|
||||||
|
if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $outval .= ' ('.getCountry($outorigin, 1).')';
|
||||||
|
|
||||||
// Units
|
// Units
|
||||||
$opt .= $outvalUnits;
|
$opt .= $outvalUnits;
|
||||||
$outval .= $outvalUnits;
|
$outval .= $outvalUnits;
|
||||||
@ -3514,11 +3571,11 @@ class Form
|
|||||||
* Return list of payment methods
|
* Return list of payment methods
|
||||||
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
*
|
*
|
||||||
* @param string $selected Id du mode de paiement pre-selectionne
|
* @param string $selected Id or code or preselected payment mode
|
||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Name of select field
|
||||||
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
|
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
|
||||||
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
|
* @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
|
||||||
* @param int $empty 1=peut etre vide, 0 sinon
|
* @param int $empty 1=can be empty, 0 otherwise
|
||||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||||
* @param int $maxlength Max length of label
|
* @param int $maxlength Max length of label
|
||||||
* @param int $active Active or not, -1 = all
|
* @param int $active Active or not, -1 = all
|
||||||
@ -3559,9 +3616,12 @@ class Form
|
|||||||
elseif ($format == 1) print '<option value="'.$arraytypes['code'].'"';
|
elseif ($format == 1) print '<option value="'.$arraytypes['code'].'"';
|
||||||
elseif ($format == 2) print '<option value="'.$arraytypes['code'].'"';
|
elseif ($format == 2) print '<option value="'.$arraytypes['code'].'"';
|
||||||
elseif ($format == 3) print '<option value="'.$id.'"';
|
elseif ($format == 3) print '<option value="'.$id.'"';
|
||||||
// Si selected est text, on compare avec code, sinon avec id
|
// Print attribute selected or not
|
||||||
if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) print ' selected';
|
if ($format==1 || $format==2) {
|
||||||
elseif ($selected == $id) print ' selected';
|
if ($selected == $arraytypes['code']) print ' selected';
|
||||||
|
} else {
|
||||||
|
if ($selected == $id) print ' selected';
|
||||||
|
}
|
||||||
print '>';
|
print '>';
|
||||||
if ($format == 0) $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
|
if ($format == 0) $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
|
||||||
elseif ($format == 1) $value = $arraytypes['code'];
|
elseif ($format == 1) $value = $arraytypes['code'];
|
||||||
@ -4740,7 +4800,7 @@ class Form
|
|||||||
print '<form method="POST" action="'.$page.'">';
|
print '<form method="POST" action="'.$page.'">';
|
||||||
print '<input type="hidden" name="action" value="setmulticurrencyrate">';
|
print '<input type="hidden" name="action" value="setmulticurrencyrate">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="text" name="'.$htmlname.'" value="'.(!empty($rate) ? price($rate) : 1).'" size="10" /> ';
|
print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CR')) : 1).'" /> ';
|
||||||
print '<select name="calculation_mode">';
|
print '<select name="calculation_mode">';
|
||||||
print '<option value="1">'.$currency.' > '.$conf->currency.'</option>';
|
print '<option value="1">'.$currency.' > '.$conf->currency.'</option>';
|
||||||
print '<option value="2">'.$conf->currency.' > '.$currency.'</option>';
|
print '<option value="2">'.$conf->currency.' > '.$currency.'</option>';
|
||||||
|
|||||||
@ -375,7 +375,11 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
if (! empty($show_empty)) {
|
if (! empty($show_empty)) {
|
||||||
$out.= '<option value="0" class="optiongrey">';
|
$out.= '<option value="0" class="optiongrey">';
|
||||||
if (! is_numeric($show_empty)) $out.=$show_empty;
|
if (! is_numeric($show_empty)) {
|
||||||
|
//if (! empty($conf->use_javascript_ajax)) $out .= '<span class="opacitymedium">aaa';
|
||||||
|
$out.=$show_empty;
|
||||||
|
//if (! empty($conf->use_javascript_ajax)) $out .= '</span>';
|
||||||
|
}
|
||||||
else $out.=' ';
|
else $out.=' ';
|
||||||
$out.= '</option>';
|
$out.= '</option>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -198,7 +198,7 @@ abstract class Stats
|
|||||||
// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)
|
// $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...)
|
||||||
for ($i = 0; $i < 12; $i++)
|
for ($i = 0; $i < 12; $i++)
|
||||||
{
|
{
|
||||||
$data[$i][] = $datay[$endyear][($i + $sm) % 12]['label']; // set label
|
$data[$i][] = isset($datay[$endyear][($i + $sm) % 12]['label']) ? $datay[$endyear][($i + $sm) % 12]['label'] : $datay[$endyear][($i + $sm) % 12][0]; // set label
|
||||||
$year = $startyear;
|
$year = $startyear;
|
||||||
while ($year <= $endyear)
|
while ($year <= $endyear)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -524,8 +524,9 @@ function hideMessage(fieldId,message) {
|
|||||||
* @param int entity Entity
|
* @param int entity Entity
|
||||||
* @param int strict Strict
|
* @param int strict Strict
|
||||||
* @param int forcereload Force reload
|
* @param int forcereload Force reload
|
||||||
|
* @param int userid User id
|
||||||
*/
|
*/
|
||||||
function setConstant(url, code, input, entity, strict, forcereload) {
|
function setConstant(url, code, input, entity, strict, forcereload, userid) {
|
||||||
$.get( url, {
|
$.get( url, {
|
||||||
action: "set",
|
action: "set",
|
||||||
name: code,
|
name: code,
|
||||||
@ -593,8 +594,9 @@ function setConstant(url, code, input, entity, strict, forcereload) {
|
|||||||
* @param int entity Entity
|
* @param int entity Entity
|
||||||
* @param int strict Strict
|
* @param int strict Strict
|
||||||
* @param int forcereload Force reload
|
* @param int forcereload Force reload
|
||||||
|
* @param int userid User id
|
||||||
*/
|
*/
|
||||||
function delConstant(url, code, input, entity, strict, forcereload) {
|
function delConstant(url, code, input, entity, strict, forcereload, userid) {
|
||||||
$.get( url, {
|
$.get( url, {
|
||||||
action: "del",
|
action: "del",
|
||||||
name: code,
|
name: code,
|
||||||
@ -661,8 +663,9 @@ function delConstant(url, code, input, entity, strict, forcereload) {
|
|||||||
* @param int yesButton yesButton
|
* @param int yesButton yesButton
|
||||||
* @param int noButton noButton
|
* @param int noButton noButton
|
||||||
* @param int strict Strict
|
* @param int strict Strict
|
||||||
|
* @param int userid User id
|
||||||
*/
|
*/
|
||||||
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
|
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict, userid) {
|
||||||
var boxConfirm = box;
|
var boxConfirm = box;
|
||||||
$("#confirm_" + code)
|
$("#confirm_" + code)
|
||||||
.attr("title", boxConfirm.title)
|
.attr("title", boxConfirm.title)
|
||||||
@ -678,9 +681,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
|||||||
text : yesButton,
|
text : yesButton,
|
||||||
click : function() {
|
click : function() {
|
||||||
if (action == "set") {
|
if (action == "set") {
|
||||||
setConstant(url, code, input, entity, strict);
|
setConstant(url, code, input, entity, strict, 0, userid);
|
||||||
} else if (action == "del") {
|
} else if (action == "del") {
|
||||||
delConstant(url, code, input, entity, strict);
|
delConstant(url, code, input, entity, strict, 0, userid);
|
||||||
}
|
}
|
||||||
// Close dialog
|
// Close dialog
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
|
|||||||
@ -120,7 +120,11 @@ function updateTotal(days,mode)
|
|||||||
total.setHours(0);
|
total.setHours(0);
|
||||||
total.setMinutes(0);
|
total.setMinutes(0);
|
||||||
var nbline = document.getElementById('numberOfLines').value;
|
var nbline = document.getElementById('numberOfLines').value;
|
||||||
for (var i=-1; i<nbline; i++)
|
var startline = 0;
|
||||||
|
if (document.getElementById('numberOfFirstLine')) {
|
||||||
|
startline = parseInt(document.getElementById('numberOfFirstLine').value);
|
||||||
|
}
|
||||||
|
for (var i=-1; i < nbline; i++)
|
||||||
{
|
{
|
||||||
var id='timespent['+i+']['+days+']';
|
var id='timespent['+i+']['+days+']';
|
||||||
var taskTime= new Date(0);
|
var taskTime= new Date(0);
|
||||||
@ -214,16 +218,26 @@ function updateTotal(days,mode)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold");
|
var stringdays = days;
|
||||||
else jQuery('.totalDay'+days).removeClass("bold");
|
if (startline >= 1 && startline <= 9 && stringdays < 10) {
|
||||||
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
stringdays = '0'+stringdays;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+stringdays).addClass("bold");
|
||||||
|
else jQuery('.totalDay'+stringdays).removeClass("bold");
|
||||||
|
jQuery('.totalDay'+stringdays).text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
||||||
|
|
||||||
var totalhour = 0;
|
var totalhour = 0;
|
||||||
var totalmin = 0;
|
var totalmin = 0;
|
||||||
for (var i=0; i<7; i++)
|
for (var i=0; i<7; i++)
|
||||||
{
|
{
|
||||||
|
stringdays = (i + startline);
|
||||||
|
if (startline >= 1 && startline <= 9 && stringdays < 10) {
|
||||||
|
stringdays = '0'+stringdays;
|
||||||
|
}
|
||||||
|
|
||||||
var taskTime= new Date(0);
|
var taskTime= new Date(0);
|
||||||
result=parseTime(jQuery('.totalDay'+i).text(),taskTime);
|
result=parseTime(jQuery('.totalDay'+stringdays).text(),taskTime);
|
||||||
if (result >= 0)
|
if (result >= 0)
|
||||||
{
|
{
|
||||||
totalhour = totalhour + taskTime.getHours();
|
totalhour = totalhour + taskTime.getHours();
|
||||||
@ -273,8 +287,14 @@ function updateTotal(days,mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (total) jQuery('.totalDay'+days).addClass("bold");
|
var stringdays = days;
|
||||||
else jQuery('.totalDay'+days).removeClass("bold");
|
if (startline >= 1 && startline <= 9 && stringdays < 10) {
|
||||||
jQuery('.totalDay'+days).text(total);
|
stringdays = '0'+stringdays;
|
||||||
|
console.log(stringdays);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (total) jQuery('.totalDay'+stringdays).addClass("bold");
|
||||||
|
else jQuery('.totalDay'+stringdays).removeClass("bold");
|
||||||
|
jQuery('.totalDay'+stringdays).text(total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,7 +59,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
|||||||
|
|
||||||
// Filters
|
// Filters
|
||||||
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
|
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||||
print '<input type="hidden" name="year" value="' . $year . '">';
|
print '<input type="hidden" name="year" value="' . $year . '">';
|
||||||
print '<input type="hidden" name="month" value="' . $month . '">';
|
print '<input type="hidden" name="month" value="' . $month . '">';
|
||||||
print '<input type="hidden" name="day" value="' . $day . '">';
|
print '<input type="hidden" name="day" value="' . $day . '">';
|
||||||
|
|||||||
@ -485,7 +485,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
|
|||||||
*/
|
*/
|
||||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2)
|
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
||||||
|
|
||||||
@ -504,6 +504,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
|||||||
var code = \''.$code.'\';
|
var code = \''.$code.'\';
|
||||||
var entity = \''.$entity.'\';
|
var entity = \''.$entity.'\';
|
||||||
var strict = \''.$strict.'\';
|
var strict = \''.$strict.'\';
|
||||||
|
var userid = \''.$user->id.'\';
|
||||||
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
|
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
|
||||||
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
|
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
|
||||||
|
|
||||||
@ -512,9 +513,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
|||||||
if (input.alert && input.alert.set) {
|
if (input.alert && input.alert.set) {
|
||||||
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
|
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
|
||||||
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
|
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
|
||||||
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict);
|
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict, userid);
|
||||||
} else {
|
} else {
|
||||||
setConstant(url, code, input, entity, 0, '.$forcereload.');
|
setConstant(url, code, input, entity, 0, '.$forcereload.', userid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -523,9 +524,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
|||||||
if (input.alert && input.alert.del) {
|
if (input.alert && input.alert.del) {
|
||||||
if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton;
|
if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton;
|
||||||
if (input.alert.del.noButton) noButton = input.alert.del.noButton;
|
if (input.alert.del.noButton) noButton = input.alert.del.noButton;
|
||||||
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict);
|
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict, userid);
|
||||||
} else {
|
} else {
|
||||||
delConstant(url, code, input, entity, 0, '.$forcereload.');
|
delConstant(url, code, input, entity, 0, '.$forcereload.', userid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -104,8 +104,9 @@ function societe_prepare_head(Societe $object)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) $supplier_module_enabled=1;
|
$supplier_module_enabled = 0;
|
||||||
if ($supplier_module_enabled==1 && $object->fournisseur && !empty($user->rights->fournisseur->lire))
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) $supplier_module_enabled=1;
|
||||||
|
if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Supplier");
|
$head[$h][1] = $langs->trans("Supplier");
|
||||||
@ -1099,7 +1100,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
if (!empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
|
if (!empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
|
||||||
if ($key == 'role') $align .= ($align ? ' ' : '').'left';
|
if ($key == 'role') $align .= ($align ? ' ' : '').'left';
|
||||||
if (!empty($arrayfields['sc.'.$key]['checked'])) {
|
if (!empty($arrayfields['sc.'.$key]['checked'])) {
|
||||||
print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'sc.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
|
print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -1318,6 +1319,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
}
|
}
|
||||||
$sortfield_new = implode(',', $sortfield_new_list);
|
$sortfield_new = implode(',', $sortfield_new_list);
|
||||||
|
|
||||||
|
$sql = '';
|
||||||
|
|
||||||
if (!empty($conf->agenda->enabled))
|
if (!empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
// Recherche histo sur actioncomm
|
// Recherche histo sur actioncomm
|
||||||
@ -1469,6 +1472,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO Add limit in nb of results
|
//TODO Add limit in nb of results
|
||||||
|
if ($sql)
|
||||||
|
{
|
||||||
$sql .= $db->order($sortfield_new, $sortorder);
|
$sql .= $db->order($sortfield_new, $sortorder);
|
||||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -1549,6 +1554,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email)))
|
if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email)))
|
||||||
{
|
{
|
||||||
@ -1782,9 +1788,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
}
|
}
|
||||||
$out .= "</table>\n";
|
$out .= "</table>\n";
|
||||||
$out .= "</div>\n";
|
$out .= "</div>\n";
|
||||||
}
|
|
||||||
|
|
||||||
$out .= '</form>';
|
$out .= '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($noprint) return $out;
|
if ($noprint) return $out;
|
||||||
else print $out;
|
else print $out;
|
||||||
|
|||||||
@ -66,9 +66,9 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
|||||||
* @param string $element Current element
|
* @param string $element Current element
|
||||||
* 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource',
|
* 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource',
|
||||||
* 'product', 'productprice', 'stock', 'bom', 'mo',
|
* 'product', 'productprice', 'stock', 'bom', 'mo',
|
||||||
* 'propal', 'supplier_proposal', 'invoice', 'facture_fourn', 'payment_various',
|
* 'propal', 'supplier_proposal', 'invoice', 'supplier_invoice', 'payment_various',
|
||||||
* 'categorie', 'bank_account', 'bank_account', 'adherent', 'user',
|
* 'categorie', 'bank_account', 'bank_account', 'adherent', 'user',
|
||||||
* 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey',
|
* 'commande', 'supplier_order', 'expedition', 'intervention', 'survey',
|
||||||
* 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
|
* 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
|
||||||
* 'email_template', 'event', 'donation'
|
* 'email_template', 'event', 'donation'
|
||||||
* 'c_paiement', 'c_payment_term', ...
|
* 'c_paiement', 'c_payment_term', ...
|
||||||
@ -3127,11 +3127,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
} else {
|
} else {
|
||||||
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
||||||
|
|
||||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
|
||||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||||
'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
||||||
'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
'filter', 'file-code', 'grip', 'grip_title', 'language', 'list', 'listlight', 'note',
|
||||||
|
'object_phoning', 'object_phoning_fax', 'object_email',
|
||||||
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
||||||
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
|
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
|
||||||
@ -3154,7 +3154,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
|
|
||||||
$arrayconvpictotofa = array(
|
$arrayconvpictotofa = array(
|
||||||
'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt',
|
'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt',
|
||||||
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open',
|
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'globe'=>'external-link-alt',
|
||||||
|
'object_phoning'=>'phone', 'object_phoning_fax'=>'fax', 'object_email'=>'at',
|
||||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar',
|
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar',
|
||||||
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch',
|
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch',
|
||||||
'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table',
|
'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table',
|
||||||
@ -3196,7 +3197,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
}
|
}
|
||||||
elseif ($pictowithouttext == 'delete') {
|
elseif ($pictowithouttext == 'delete') {
|
||||||
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
|
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
|
||||||
$facolor = '#444';
|
|
||||||
}
|
}
|
||||||
elseif ($pictowithouttext == 'edit') {
|
elseif ($pictowithouttext == 'edit') {
|
||||||
$facolor = '#444';
|
$facolor = '#444';
|
||||||
@ -3239,18 +3239,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
$fakey = 'fa-sign-out-alt';
|
$fakey = 'fa-sign-out-alt';
|
||||||
$marginleftonlyshort = 0;
|
$marginleftonlyshort = 0;
|
||||||
}
|
}
|
||||||
elseif ($pictowithouttext == 'unlink') {
|
|
||||||
$fakey = 'fa-unlink';
|
|
||||||
$facolor = '#555';
|
|
||||||
}
|
|
||||||
elseif ($pictowithouttext == 'playdisabled') {
|
elseif ($pictowithouttext == 'playdisabled') {
|
||||||
$fakey = 'fa-play';
|
$fakey = 'fa-play';
|
||||||
$facolor = '#ccc';
|
$facolor = '#ccc';
|
||||||
}
|
}
|
||||||
elseif ($pictowithouttext == 'play') {
|
|
||||||
$fakey = 'fa-play';
|
|
||||||
$facolor = '#444';
|
|
||||||
}
|
|
||||||
elseif ($pictowithouttext == 'jabber') {
|
elseif ($pictowithouttext == 'jabber') {
|
||||||
$fakey = 'fa-comment-o';
|
$fakey = 'fa-comment-o';
|
||||||
}
|
}
|
||||||
@ -3262,12 +3254,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
elseif (!empty($arrayconvpictotofa[$pictowithouttext]))
|
elseif (!empty($arrayconvpictotofa[$pictowithouttext]))
|
||||||
{
|
{
|
||||||
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
|
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
|
||||||
//$facolor = '#444';
|
|
||||||
$marginleftonlyshort = 0;
|
$marginleftonlyshort = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fakey = 'fa-'.$pictowithouttext;
|
$fakey = 'fa-'.$pictowithouttext;
|
||||||
//$facolor = '#444';
|
|
||||||
$marginleftonlyshort = 0;
|
$marginleftonlyshort = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3305,6 +3295,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we ask an image into $url/$mymodule/img (instead of default path)
|
// If we ask an image into $url/$mymodule/img (instead of default path)
|
||||||
|
$regs = array();
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
|
if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
|
||||||
$picto = $regs[1];
|
$picto = $regs[1];
|
||||||
$path = $regs[2]; // $path is $mymodule
|
$path = $regs[2]; // $path is $mymodule
|
||||||
@ -3538,7 +3529,6 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"')
|
|||||||
if ($titlealt == 'default') $titlealt = $langs->trans('Delete');
|
if ($titlealt == 'default') $titlealt = $langs->trans('Delete');
|
||||||
|
|
||||||
return img_picto($titlealt, 'delete.png', $other);
|
return img_picto($titlealt, 'delete.png', $other);
|
||||||
//return '<span class="fa fa-trash fa-2x fa-fw" style="font-size: 1.7em;" title="'.$titlealt.'"></span>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3763,10 +3753,13 @@ function img_allow($allow, $titlealt = 'default')
|
|||||||
* Return image of a credit card according to its brand name
|
* Return image of a credit card according to its brand name
|
||||||
*
|
*
|
||||||
* @param string $brand Brand name of credit card
|
* @param string $brand Brand name of credit card
|
||||||
|
* @param string $morecss More CSS
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
*/
|
*/
|
||||||
function img_credit_card($brand)
|
function img_credit_card($brand, $morecss = null)
|
||||||
{
|
{
|
||||||
|
if (is_null($morecss)) $morecss = 'fa-2x';
|
||||||
|
|
||||||
if ($brand == 'visa' || $brand == 'Visa') {$brand = 'cc-visa'; }
|
if ($brand == 'visa' || $brand == 'Visa') {$brand = 'cc-visa'; }
|
||||||
elseif ($brand == 'mastercard' || $brand == 'MasterCard') {$brand = 'cc-mastercard'; }
|
elseif ($brand == 'mastercard' || $brand == 'MasterCard') {$brand = 'cc-mastercard'; }
|
||||||
elseif ($brand == 'amex' || $brand == 'American Express') {$brand = 'cc-amex'; }
|
elseif ($brand == 'amex' || $brand == 'American Express') {$brand = 'cc-amex'; }
|
||||||
@ -3775,7 +3768,7 @@ function img_credit_card($brand)
|
|||||||
elseif ($brand == 'diners' || $brand == 'Diners club') {$brand = 'cc-diners-club'; }
|
elseif ($brand == 'diners' || $brand == 'Diners club') {$brand = 'cc-diners-club'; }
|
||||||
elseif (!in_array($brand, array('cc-visa', 'cc-mastercard', 'cc-amex', 'cc-discover', 'cc-jcb', 'cc-diners-club'))) {$brand = 'credit-card'; }
|
elseif (!in_array($brand, array('cc-visa', 'cc-mastercard', 'cc-amex', 'cc-discover', 'cc-jcb', 'cc-diners-club'))) {$brand = 'credit-card'; }
|
||||||
|
|
||||||
return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>';
|
return '<span class="fa fa-'.$brand.' fa-fw'.($morecss ? ' '.$morecss : '').'"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -4656,6 +4649,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
|||||||
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
|
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
|
||||||
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
|
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
|
||||||
* 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
|
* 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
|
||||||
|
* 'CR'=Currency rate
|
||||||
* Numeric = Nb of digits for rounding
|
* Numeric = Nb of digits for rounding
|
||||||
* @param int $alreadysqlnb Put 1 if you know that content is already universal format number
|
* @param int $alreadysqlnb Put 1 if you know that content is already universal format number
|
||||||
* @return string Amount with universal numeric format (Example: '99.99999').
|
* @return string Amount with universal numeric format (Example: '99.99999').
|
||||||
@ -4709,6 +4703,7 @@ function price2num($amount, $rounding = '', $alreadysqlnb = 0)
|
|||||||
if ($rounding == 'MU') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
if ($rounding == 'MU') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||||
elseif ($rounding == 'MT') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
elseif ($rounding == 'MT') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||||
elseif ($rounding == 'MS') $nbofdectoround = empty($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
|
elseif ($rounding == 'MS') $nbofdectoround = empty($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
|
||||||
|
elseif ($rounding == 'CR') $nbofdectoround = 8;
|
||||||
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
|
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
|
||||||
//print "RR".$amount.' - '.$nbofdectoround.'<br>';
|
//print "RR".$amount.' - '.$nbofdectoround.'<br>';
|
||||||
if (dol_strlen($nbofdectoround)) $amount = round($amount, $nbofdectoround); // $nbofdectoround can be 0.
|
if (dol_strlen($nbofdectoround)) $amount = round($amount, $nbofdectoround); // $nbofdectoround can be 0.
|
||||||
@ -8425,16 +8420,16 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
|
|
||||||
// For backward compatibility. Image's filename are still in French, so we use this array to convert
|
// For backward compatibility. Image's filename are still in French, so we use this array to convert
|
||||||
$statusImg = array(
|
$statusImg = array(
|
||||||
'status0' => 'statut0'
|
'status0' => 'statut0',
|
||||||
,'status1' => 'statut1'
|
'status1' => 'statut1',
|
||||||
,'status2' => 'statut2'
|
'status2' => 'statut2',
|
||||||
,'status3' => 'statut3'
|
'status3' => 'statut3',
|
||||||
,'status4' => 'statut4'
|
'status4' => 'statut4',
|
||||||
,'status5' => 'statut5'
|
'status5' => 'statut5',
|
||||||
,'status6' => 'statut6'
|
'status6' => 'statut6',
|
||||||
,'status7' => 'statut7'
|
'status7' => 'statut7',
|
||||||
,'status8' => 'statut8'
|
'status8' => 'statut8',
|
||||||
,'status9' => 'statut9'
|
'status9' => 'statut9'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($statusImg[$statusType])) {
|
if (!empty($statusImg[$statusType])) {
|
||||||
|
|||||||
@ -358,7 +358,7 @@ function project_admin_prepare_head()
|
|||||||
*/
|
*/
|
||||||
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0)
|
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0)
|
||||||
{
|
{
|
||||||
global $user, $bc, $langs, $conf, $db;
|
global $user, $langs, $conf, $db;
|
||||||
global $projectstatic, $taskstatic;
|
global $projectstatic, $taskstatic;
|
||||||
|
|
||||||
$lastprojectid = 0;
|
$lastprojectid = 0;
|
||||||
@ -450,7 +450,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
$lastprojectid = $lines[$i]->fk_project;
|
$lastprojectid = $lines[$i]->fk_project;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr '.$bc[$var].' id="row-'.$lines[$i]->id.'">'."\n";
|
print '<tr class="oddeven" id="row-'.$lines[$i]->id.'">'."\n";
|
||||||
|
|
||||||
$projectstatic->id = $lines[$i]->fk_project;
|
$projectstatic->id = $lines[$i]->fk_project;
|
||||||
$projectstatic->ref = $lines[$i]->projectref;
|
$projectstatic->ref = $lines[$i]->projectref;
|
||||||
@ -758,7 +758,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
*/
|
*/
|
||||||
function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0)
|
function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0)
|
||||||
{
|
{
|
||||||
global $conf, $db, $user, $bc, $langs;
|
global $conf, $db, $user, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
||||||
|
|
||||||
$lastprojectid = 0;
|
$lastprojectid = 0;
|
||||||
@ -830,7 +830,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
|
|||||||
|
|
||||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven trforbreak">'."\n";
|
print '<tr class="oddeven trforbreak nobold">'."\n";
|
||||||
print '<td colspan="11">';
|
print '<td colspan="11">';
|
||||||
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
print $projectstatic->getNomUrl(1, '', 0, $langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||||
if ($projectstatic->title)
|
if ($projectstatic->title)
|
||||||
@ -986,7 +986,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
|
|||||||
*/
|
*/
|
||||||
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
|
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
|
||||||
{
|
{
|
||||||
global $conf, $db, $user, $bc, $langs;
|
global $conf, $db, $user, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
||||||
|
|
||||||
$lastprojectid = 0;
|
$lastprojectid = 0;
|
||||||
@ -1073,7 +1073,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++;
|
if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven trforbreak">'."\n";
|
print '<tr class="oddeven trforbreak nobold">'."\n";
|
||||||
print '<td colspan="'.(7 + $addcolspan).'">';
|
print '<td colspan="'.(7 + $addcolspan).'">';
|
||||||
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
||||||
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
||||||
@ -1177,15 +1177,12 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
// Ref
|
// Ref
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
|
||||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||||
// Label task
|
// Label task
|
||||||
print '<br>';
|
print '<br>';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
print '<span class="opacitymedium">'.$taskstatic->label.'</a>';
|
||||||
print $taskstatic->label;
|
for ($k = 0; $k < $level; $k++) print "</div>";
|
||||||
//print "<br>";
|
|
||||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
|
||||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// TASK extrafields
|
// TASK extrafields
|
||||||
@ -1365,7 +1362,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
*/
|
*/
|
||||||
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
|
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
|
||||||
{
|
{
|
||||||
global $conf, $db, $user, $bc, $langs;
|
global $conf, $db, $user, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
||||||
|
|
||||||
$numlines = count($lines);
|
$numlines = count($lines);
|
||||||
@ -1452,7 +1449,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
|||||||
if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++;
|
if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven trforbreak">'."\n";
|
print '<tr class="oddeven trforbreak nobold">'."\n";
|
||||||
print '<td colspan="'.(11 + $addcolspan).'">';
|
print '<td colspan="'.(11 + $addcolspan).'">';
|
||||||
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
||||||
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
||||||
@ -1556,16 +1553,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
|||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
|
||||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||||
// Label task
|
// Label task
|
||||||
print '<br>';
|
print '<br>';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
print '<span class="opacitymedium">'.$taskstatic->label.'</span>';
|
||||||
//print $taskstatic->getNomUrl(0, 'withproject', 'time');
|
for ($k = 0; $k < $level; $k++) print "</div>";
|
||||||
print $taskstatic->label;
|
|
||||||
//print "<br>";
|
|
||||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
|
||||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// TASK extrafields
|
// TASK extrafields
|
||||||
@ -1732,7 +1725,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
|||||||
*/
|
*/
|
||||||
function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array())
|
function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array())
|
||||||
{
|
{
|
||||||
global $conf, $db, $user, $bc, $langs;
|
global $conf, $db, $user, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
|
||||||
|
|
||||||
$numlines = count($lines);
|
$numlines = count($lines);
|
||||||
@ -1804,7 +1797,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
|||||||
|
|
||||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven trforbreak">'."\n";
|
print '<tr class="oddeven trforbreak nobold">'."\n";
|
||||||
print '<td colspan="'.(6 + count($TWeek)).'">';
|
print '<td colspan="'.(6 + count($TWeek)).'">';
|
||||||
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
print $projectstatic->getNomUrl(1, '', 0, '<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
||||||
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
||||||
@ -1840,16 +1833,12 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
|||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
|
||||||
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||||
// Label task
|
// Label task
|
||||||
print '<br>';
|
print '<br>';
|
||||||
for ($k = 0; $k < $level; $k++) print " ";
|
print '<span class="opacitymedium">'.$taskstatic->label.'</span>';
|
||||||
//print $taskstatic->getNomUrl(0, 'withproject', 'time');
|
for ($k = 0; $k < $level; $k++) print "</div>";
|
||||||
print $taskstatic->label;
|
|
||||||
//print "<br>";
|
|
||||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
|
||||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Planned Workload
|
// Planned Workload
|
||||||
@ -1917,16 +1906,16 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
|||||||
$alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb);
|
$alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb);
|
||||||
|
|
||||||
|
|
||||||
$tableCell = '<td align="center" class="hide">';
|
$tableCell = '<td class="center hide weekend">';
|
||||||
$placeholder = '';
|
$placeholder = '';
|
||||||
if ($alreadyspent)
|
if ($alreadyspent)
|
||||||
{
|
{
|
||||||
$tableCell .= '<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled id="timespent['.$inc.']['.$weekNb.']" name="task['.$lines[$i]->id.']['.$weekNb.']" value="'.$alreadyspent.'"></span>';
|
$tableCell .= '<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled id="timespent['.$inc.']['.((int) $weekNb).']" name="task['.$lines[$i]->id.']['.$weekNb.']" value="'.$alreadyspent.'"></span>';
|
||||||
//$placeholder=' placeholder="00:00"';
|
//$placeholder=' placeholder="00:00"';
|
||||||
//$tableCell.='+';
|
//$tableCell.='+';
|
||||||
}
|
}
|
||||||
|
|
||||||
$tableCell .= '<input type="text" alt="'.($disabledtask ? '' : $alttitle).'" title="'.($disabledtask ? '' : $alttitle).'" '.($disabledtask ? 'disabled' : $placeholder).' class="center smallpadd" size="2" id="timeadded['.$inc.']['.$TFirstDay[$weekNb].']" name="task['.$lines[$i]->id.']['.$TFirstDay[$weekNb].']" value="" cols="2" maxlength="5"';
|
$tableCell .= '<input type="text" alt="'.($disabledtask ? '' : $alttitle).'" title="'.($disabledtask ? '' : $alttitle).'" '.($disabledtask ? 'disabled' : $placeholder).' class="center smallpadd" size="2" id="timeadded['.$inc.']['.((int) $weekNb).']" name="task['.$lines[$i]->id.']['.$TFirstDay[$weekNb].']" value="" cols="2" maxlength="5"';
|
||||||
$tableCell .= ' onkeypress="return regexEvent(this,event,\'timeChar\')"';
|
$tableCell .= ' onkeypress="return regexEvent(this,event,\'timeChar\')"';
|
||||||
$tableCell .= ' onkeyup="updateTotal('.$weekNb.',\''.$modeinput.'\')"';
|
$tableCell .= ' onkeyup="updateTotal('.$weekNb.',\''.$modeinput.'\')"';
|
||||||
$tableCell .= ' onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$weekNb.',\''.$modeinput.'\')" />';
|
$tableCell .= ' onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$weekNb.',\''.$modeinput.'\')" />';
|
||||||
@ -2029,7 +2018,7 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
|
|||||||
*/
|
*/
|
||||||
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array())
|
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array())
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user, $bc;
|
global $langs, $conf, $user;
|
||||||
global $theme_datacolor;
|
global $theme_datacolor;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|||||||
@ -942,6 +942,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").'</td>';
|
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
|
//print ajax_constantonoff("MAIN_OPTIMIZEFORTEXTBROWSER", array(), null, 0, 0, 1, 0);
|
||||||
if ($edit)
|
if ($edit)
|
||||||
{
|
{
|
||||||
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
|
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
|
||||||
|
|||||||
@ -710,12 +710,14 @@ function getSocialNetworkSharingLinks()
|
|||||||
* WARNING: This function can be used by websites.
|
* WARNING: This function can be used by websites.
|
||||||
*
|
*
|
||||||
* @param string $type Type of container to search into (Example: '', 'page', 'blogpost', 'page,blogpost', ...)
|
* @param string $type Type of container to search into (Example: '', 'page', 'blogpost', 'page,blogpost', ...)
|
||||||
* @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination, ...)
|
* @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,...')
|
||||||
* @param string $searchstring Search string
|
* @param string $searchstring Search string
|
||||||
* @param int $max Max number of answers
|
* @param int $max Max number of answers
|
||||||
|
* @param string $sortfield Sort Fields
|
||||||
|
* @param string $sortorder Sort order ('DESC' or 'ASC')
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25)
|
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC')
|
||||||
{
|
{
|
||||||
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
|
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
|
||||||
|
|
||||||
@ -778,6 +780,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25)
|
|||||||
}
|
}
|
||||||
$sql .= $searchalgo;
|
$sql .= $searchalgo;
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
$sql .= $db->plimit($max);
|
$sql .= $db->plimit($max);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -421,7 +421,6 @@ function dolSaveReadme($file, $content)
|
|||||||
function showWebsiteTemplates(Website $website)
|
function showWebsiteTemplates(Website $website)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $db, $form;
|
global $conf, $langs, $db, $form;
|
||||||
global $bc;
|
|
||||||
|
|
||||||
$dirthemes = array('/doctemplates/websites');
|
$dirthemes = array('/doctemplates/websites');
|
||||||
if (!empty($conf->modules_parts['websitetemplates'])) // Using this feature slow down application
|
if (!empty($conf->modules_parts['websitetemplates'])) // Using this feature slow down application
|
||||||
@ -521,21 +520,3 @@ function showWebsiteTemplates(Website $website)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return HTML content to add structured data for an article, news or Blog Post.
|
|
||||||
*
|
|
||||||
* @return string HTML content
|
|
||||||
*/
|
|
||||||
function getRSSForBlogPosts()
|
|
||||||
{
|
|
||||||
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -158,6 +158,11 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
|
||||||
|
-- Commercial - Supplier's proposals
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'commercial', '', 1600__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 2, 0, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'commercial', '', 1600__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1610__+MAX_llx_menu__, 'commercial', '', 1600__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__);
|
||||||
-- Commercial - Supplier's orders
|
-- Commercial - Supplier's orders
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
||||||
|
|||||||
@ -936,6 +936,16 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
|
$newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Supplier proposal
|
||||||
|
if (!empty($conf->supplier_proposal->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("supplier_proposal");
|
||||||
|
$newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300);
|
||||||
|
$newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer);
|
||||||
|
$newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->rights->supplier_proposal->lire);
|
||||||
|
$newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->supplier_proposal->lire);
|
||||||
|
}
|
||||||
|
|
||||||
// Suppliers orders
|
// Suppliers orders
|
||||||
if (!empty($conf->supplier_order->enabled))
|
if (!empty($conf->supplier_order->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2256,4 +2256,63 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
{
|
{
|
||||||
return $this->_remove(array(), $options);
|
return $this->_remove(array(), $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return Kanban view of a module
|
||||||
|
*
|
||||||
|
* @return string HTML code of Kanban view
|
||||||
|
*/
|
||||||
|
public function getKanbanView()
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
// Define imginfo
|
||||||
|
$imginfo = "info";
|
||||||
|
if ($this->isCoreOrExternalModule() == 'external')
|
||||||
|
{
|
||||||
|
$imginfo = "info_black";
|
||||||
|
}
|
||||||
|
|
||||||
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
||||||
|
|
||||||
|
// Activate/Disable and Setup (2 columns)
|
||||||
|
if (!empty($conf->global->$const_name)) // If module is already activated
|
||||||
|
{
|
||||||
|
$disableSetup = 0;
|
||||||
|
} else {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
print '
|
||||||
|
<div class="box-flex-item info-box-module">
|
||||||
|
<div class="info-box info-box-sm info-box-weather info-box-weather-level4">
|
||||||
|
<span class="info-box-icon">';
|
||||||
|
|
||||||
|
$alttext = '';
|
||||||
|
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||||
|
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||||
|
if (!empty($this->picto))
|
||||||
|
{
|
||||||
|
if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle width50"', 1);
|
||||||
|
else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle width50"');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($alttext, 'generic', 'class="inline-block valignmiddle width50"');
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<img src="/dolibarr_dev/htdocs/theme/eldy/img/weather/weather-storm.png" alt="" class="inline-block valignmiddle width50"></span>
|
||||||
|
<div class="info-box-content info-box-text-module">
|
||||||
|
<span class="info-box-title">'.$this->getName().'</span>
|
||||||
|
<span class="info-box-desc twolinesmax">'.nl2br($this->getDesc()).'</span>';
|
||||||
|
|
||||||
|
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||||
|
|
||||||
|
print '
|
||||||
|
<span class="progress-description"><span class="opacitymedium">'.$this->getVersion(1).'</span></span>
|
||||||
|
</div><!-- /.info-box-content -->
|
||||||
|
</div><!-- /.info-box -->
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,58 +144,6 @@ class modSupplierProposal extends DolibarrModules
|
|||||||
// Main menu entries
|
// Main menu entries
|
||||||
$this->menu = array(); // List of menus to add
|
$this->menu = array(); // List of menus to add
|
||||||
$r=0;
|
$r=0;
|
||||||
$this->menu[$r]=array(
|
|
||||||
'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
|
||||||
'type'=>'left', // This is a Left menu entry
|
|
||||||
'titre'=>'SupplierProposalsShort',
|
|
||||||
'leftmenu'=>'supplier_proposalsubmenu',
|
|
||||||
'url'=>'/supplier_proposal/index.php',
|
|
||||||
'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
|
||||||
'enabled'=>'$conf->supplier_proposal->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
|
||||||
'perms'=>'$user->rights->supplier_proposal->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
|
||||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
|
||||||
'position'=>300
|
|
||||||
);
|
|
||||||
$r++;
|
|
||||||
|
|
||||||
$this->menu[$r]=array(
|
|
||||||
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
|
|
||||||
'type'=>'left',
|
|
||||||
'titre'=>'SupplierProposalNew',
|
|
||||||
'url'=>'/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals',
|
|
||||||
'langs'=>'supplier_proposal',
|
|
||||||
'enabled'=>'$conf->supplier_proposal->enabled',
|
|
||||||
'perms'=>'$user->rights->supplier_proposal->creer',
|
|
||||||
'user'=>2,
|
|
||||||
'position'=>301
|
|
||||||
);
|
|
||||||
$r++;
|
|
||||||
|
|
||||||
$this->menu[$r]=array(
|
|
||||||
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
|
|
||||||
'type'=>'left',
|
|
||||||
'titre'=>'List',
|
|
||||||
'url'=>'/supplier_proposal/list.php?leftmenu=supplier_proposals',
|
|
||||||
'langs'=>'supplier_proposal',
|
|
||||||
'enabled'=>'$conf->supplier_proposal->enabled',
|
|
||||||
'perms'=>'$user->rights->supplier_proposal->lire',
|
|
||||||
'user'=>2,
|
|
||||||
'position'=>302
|
|
||||||
);
|
|
||||||
$r++;
|
|
||||||
|
|
||||||
$this->menu[$r]=array(
|
|
||||||
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
|
|
||||||
'type'=>'left',
|
|
||||||
'titre'=>'Statistics',
|
|
||||||
'url'=>'/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier',
|
|
||||||
'langs'=>'supplier_proposal',
|
|
||||||
'enabled'=>'$conf->supplier_proposal->enabled',
|
|
||||||
'perms'=>'$user->rights->supplier_proposal->lire',
|
|
||||||
'user'=>2,
|
|
||||||
'position'=>303
|
|
||||||
);
|
|
||||||
$r++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -190,7 +190,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extrafields->fetch_name_optionals_label($task->table_element, true);
|
$extrafields->fetch_name_optionals_label($task->table_element, true);
|
||||||
$task->fetch_optionals($task->id);
|
$task->fetch_optionals();
|
||||||
|
|
||||||
$resarray = $this->fill_substitutionarray_with_extrafields($task, $resarray, $extrafields, 'task', $outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($task, $resarray, $extrafields, 'task', $outputlangs);
|
||||||
|
|
||||||
|
|||||||
@ -550,15 +550,15 @@ if ($num > 0)
|
|||||||
$backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : ''));
|
$backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : ''));
|
||||||
if ($user->rights->cron->create)
|
if ($user->rights->cron->create)
|
||||||
{
|
{
|
||||||
print "<a href=\"".DOL_URL_ROOT."/cron/card.php?id=".$obj->rowid."&action=edit".($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param;
|
print '<a class="editfielda" href="'.DOL_URL_ROOT."/cron/card.php?id=".$obj->rowid."&action=edit".($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param;
|
||||||
print "&backtourl=".$backtourl."\" title=\"".dol_escape_htmltag($langs->trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."</a> ";
|
print "&backtourl=".$backtourl."\" title=\"".dol_escape_htmltag($langs->trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."</a> ";
|
||||||
}
|
}
|
||||||
if ($user->rights->cron->delete)
|
if ($user->rights->cron->delete)
|
||||||
{
|
{
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"]."?id=".$obj->rowid."&action=delete".($page ? '&page='.$page : '').($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param;
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"]."?id=".$obj->rowid."&action=delete".($page ? '&page='.$page : '').($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param;
|
||||||
print "\" title=\"".dol_escape_htmltag($langs->trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete')."</a> ";
|
print "\" title=\"".dol_escape_htmltag($langs->trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete', '', false, 0, 0, '', 'marginleftonly')."</a> ";
|
||||||
} else {
|
} else {
|
||||||
print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete')."</a> ";
|
print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete', '', false, 0, 0, '', 'marginleftonly')."</a> ";
|
||||||
}
|
}
|
||||||
if ($user->rights->cron->execute)
|
if ($user->rights->cron->execute)
|
||||||
{
|
{
|
||||||
@ -567,12 +567,12 @@ if ($num > 0)
|
|||||||
print (empty($conf->global->CRON_KEY) ? '' : '&securitykey='.$conf->global->CRON_KEY);
|
print (empty($conf->global->CRON_KEY) ? '' : '&securitykey='.$conf->global->CRON_KEY);
|
||||||
print ($sortfield ? '&sortfield='.$sortfield : '');
|
print ($sortfield ? '&sortfield='.$sortfield : '');
|
||||||
print ($sortorder ? '&sortorder='.$sortorder : '');
|
print ($sortorder ? '&sortorder='.$sortorder : '');
|
||||||
print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play").'</a>';
|
print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', false, 0, 0, '', 'marginleftonly').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans('JobDisabled')).'">'.img_picto($langs->trans('JobDisabled'), "playdisabled").'</a>';
|
print '<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans('JobDisabled')).'">'.img_picto($langs->trans('JobDisabled'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').'</a>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled").'</a>';
|
print '<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').'</a>';
|
||||||
}
|
}
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
{
|
{
|
||||||
|
|||||||
@ -445,7 +445,7 @@ if ($action == 'create')
|
|||||||
if (!empty($conf->projet->enabled))
|
if (!empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||||
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit')
|
|||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||||
$formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1);
|
$formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit')
|
|||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -178,7 +178,7 @@ class Don extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
if ($status == self::STATUS_CANCELED) $statusType = 'status5';
|
if ($status == self::STATUS_CANCELED) $statusType = 'status9';
|
||||||
if ($status == self::STATUS_PAID) $statusType = 'status6';
|
if ($status == self::STATUS_PAID) $statusType = 'status6';
|
||||||
|
|
||||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||||
|
|||||||
@ -118,6 +118,10 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dataseries = array();
|
||||||
|
$colorseries = array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -128,6 +132,10 @@ $listofstatus = array(0, 1, -1, 2);
|
|||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($donstatic->LibStatut($status, 1), (isset($nb[$status]) ? (int) $nb[$status] : 0));
|
$dataseries[] = array($donstatic->LibStatut($status, 1), (isset($nb[$status]) ? (int) $nb[$status] : 0));
|
||||||
|
if ($status == Don::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == Don::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == Don::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
if ($status == Don::STATUS_PAID) $colorseries[$status] = $badgeStatus6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
@ -137,6 +145,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
|
|||||||
@ -1574,8 +1574,8 @@ if ($action == 'create')
|
|||||||
$expLine = new ExpeditionLigne($db);
|
$expLine = new ExpeditionLigne($db);
|
||||||
|
|
||||||
$srcLine = new OrderLine($db);
|
$srcLine = new OrderLine($db);
|
||||||
$srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline
|
$srcLine->id = $line->id;
|
||||||
//$line->fetch_optionals($line->id);
|
$srcLine->fetch_optionals(); // fetch extrafields also available in orderline
|
||||||
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
||||||
|
|
||||||
print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
|
print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
|
||||||
@ -2012,7 +2012,7 @@ elseif ($id || $ref)
|
|||||||
if ($action == 'editline')
|
if ($action == 'editline')
|
||||||
{
|
{
|
||||||
print ' <form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$line_id.'" method="POST">
|
print ' <form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$line_id.'" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
|
<input type="hidden" name="token" value="' . newToken().'">
|
||||||
<input type="hidden" name="action" value="updateline">
|
<input type="hidden" name="action" value="updateline">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
<input type="hidden" name="id" value="' . $object->id.'">
|
<input type="hidden" name="id" value="' . $object->id.'">
|
||||||
@ -2460,7 +2460,7 @@ elseif ($id || $ref)
|
|||||||
if (!empty($conf->stock->enabled)) $colspan++;
|
if (!empty($conf->stock->enabled)) $colspan++;
|
||||||
|
|
||||||
$line = $lines[$i];
|
$line = $lines[$i];
|
||||||
$line->fetch_optionals($line->id);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
if ($action == 'editline' && $line->id == $line_id)
|
if ($action == 'editline' && $line->id == $line_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -68,6 +68,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
/*
|
/*
|
||||||
* Shipments to validate
|
* Shipments to validate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$clause = " WHERE ";
|
$clause = " WHERE ";
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.ref, e.ref_customer,";
|
$sql = "SELECT e.rowid, e.ref, e.ref_customer,";
|
||||||
@ -91,12 +92,14 @@ $resql=$db->query($sql);
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("SendingsToValidate").'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("SendingsToValidate").'</th></tr>';
|
||||||
|
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -117,132 +120,23 @@ if ($resql)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table></div><br>";
|
} else
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->trans("None").'</td><td></td><td></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</table></div><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Commandes a traiter
|
|
||||||
*/
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut, s.nom as name, s.rowid as socid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
|
|
||||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND c.fk_statut = 1";
|
|
||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
$sql.= " ORDER BY c.rowid ASC";
|
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$langs->load("orders");
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<th colspan="3">'.$langs->trans("OrdersToProcess").'</th></tr>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
$orderstatic->id=$obj->rowid;
|
|
||||||
$orderstatic->ref=$obj->ref;
|
|
||||||
$orderstatic->ref_customer=$obj->ref_customer;
|
|
||||||
$orderstatic->statut=$obj->fk_statut;
|
|
||||||
$orderstatic->billed=0;
|
|
||||||
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
print $orderstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $companystatic->getNomUrl(1, 'customer', 32);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="right">';
|
|
||||||
print $orderstatic->getLibStatut(3);
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table></div><br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//print '</td><td valign="top" width="70%">';
|
//print '</td><td valign="top" width="70%">';
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
$max = 5;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commandes en traitement
|
* Latest shipments
|
||||||
*/
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
|
|
||||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND c.fk_statut = 2";
|
|
||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ( $resql )
|
|
||||||
{
|
|
||||||
$langs->load("orders");
|
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<th colspan="3">'.$langs->trans("OrdersInProcess").'</th></tr>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
$orderstatic->id=$obj->rowid;
|
|
||||||
$orderstatic->ref=$obj->ref;
|
|
||||||
$orderstatic->ref_customer=$obj->ref_customer;
|
|
||||||
$orderstatic->statut=$obj->status;
|
|
||||||
$orderstatic->billed=$obj->billed;
|
|
||||||
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
print $orderstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $companystatic->getNomUrl(1, 'customer');
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="right">';
|
|
||||||
print $orderstatic->getLibStatut(3);
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table></div><br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dol_print_error($db);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Last shipments
|
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT e.rowid, e.ref, e.ref_customer,";
|
$sql = "SELECT e.rowid, e.ref, e.ref_customer,";
|
||||||
$sql.= " s.nom as name, s.rowid as socid,";
|
$sql.= " s.nom as name, s.rowid as socid,";
|
||||||
@ -254,10 +148,10 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
|
|||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
|
||||||
$sql.= " WHERE e.entity IN (".getEntity('expedition').")";
|
$sql.= " WHERE e.entity IN (".getEntity('expedition').")";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " AND e.fk_statut = 1";
|
$sql.= " AND e.fk_statut = ".Expedition::STATUS_VALIDATED;
|
||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||||
$sql.= " ORDER BY e.date_delivery DESC";
|
$sql.= " ORDER BY e.date_delivery DESC";
|
||||||
$sql.= $db->plimit(5, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -269,7 +163,7 @@ if ($resql)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("LastSendings", $num).'</th></tr>';
|
print '<th colspan="4">'.$langs->trans("LastSendings", $num).'</th></tr>';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -289,8 +183,11 @@ if ($resql)
|
|||||||
$orderstatic->ref=$obj->commande_ref;
|
$orderstatic->ref=$obj->commande_ref;
|
||||||
print $orderstatic->getNomUrl(1);
|
print $orderstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else print ' ';
|
print '</td>';
|
||||||
print '</td></tr>';
|
print '<td class="">';
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table></div><br>";
|
print "</table></div><br>";
|
||||||
@ -299,6 +196,72 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open orders
|
||||||
|
*/
|
||||||
|
$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND c.entity IN (".getEntity('order').")";
|
||||||
|
$sql.= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_ACCEPTED.")";
|
||||||
|
if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid;
|
||||||
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
$sql.= " ORDER BY c.rowid ASC";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ( $resql )
|
||||||
|
{
|
||||||
|
$langs->load("orders");
|
||||||
|
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th colspan="3">'.$langs->trans("OrdersToProcess").' <span class="badge">'.$num.'</span></th></tr>';
|
||||||
|
while ($i < $num && $i < 10)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$orderstatic->id=$obj->rowid;
|
||||||
|
$orderstatic->ref=$obj->ref;
|
||||||
|
$orderstatic->ref_customer=$obj->ref_customer;
|
||||||
|
$orderstatic->statut=$obj->status;
|
||||||
|
$orderstatic->billed=$obj->billed;
|
||||||
|
|
||||||
|
$companystatic->name=$obj->name;
|
||||||
|
$companystatic->id=$obj->socid;
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $orderstatic->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $companystatic->getNomUrl(1, 'customer', 32);
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="right">';
|
||||||
|
print $orderstatic->getLibStatut(3);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i < $num) {
|
||||||
|
print '<tr class="opacitymedium">';
|
||||||
|
print '<td>'.$langs->trans("More").'...</td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table></div><br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|||||||
@ -341,7 +341,7 @@ print '</table>';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<i>'.$langs->trans("StatsOnShipmentsOnlyValidated").'</i>';
|
print '<i class="opacitymedium">'.$langs->trans("StatsOnShipmentsOnlyValidated").'</i>';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -399,7 +399,7 @@ class ExpenseReport extends CommonObject
|
|||||||
|
|
||||||
// get extrafields so they will be clone
|
// get extrafields so they will be clone
|
||||||
//foreach($this->lines as $line)
|
//foreach($this->lines as $line)
|
||||||
//$line->fetch_optionals($line->rowid);
|
//$line->fetch_optionals();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$objFrom = clone $this;
|
$objFrom = clone $this;
|
||||||
|
|||||||
@ -1183,7 +1183,7 @@ class Fichinter extends CommonObject
|
|||||||
|
|
||||||
// get extrafields so they will be clone
|
// get extrafields so they will be clone
|
||||||
foreach ($this->lines as $line)
|
foreach ($this->lines as $line)
|
||||||
$line->fetch_optionals($line->rowid);
|
$line->fetch_optionals();
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$objFrom = clone $this;
|
$objFrom = clone $this;
|
||||||
|
|||||||
@ -122,16 +122,24 @@ if ($resql)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\n";
|
||||||
$listofstatus = array(0, 1, 2);
|
$listofstatus = array(0, 1, 3);
|
||||||
$bool = false;
|
$bool = false;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($fichinterstatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool]) ? (int) $vals[$status.$bool] : 0));
|
$dataseries[] = array($fichinterstatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool]) ? (int) $vals[$status.$bool] : 0));
|
||||||
if ($status == 3 && !$bool) $bool = true;
|
if ($status == 3 && !$bool) $bool = true;
|
||||||
else $bool = false;
|
else $bool = false;
|
||||||
|
|
||||||
|
if ($status == Fichinter::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == Fichinter::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == Fichinter::STATUS_BILLED) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == Fichinter::STATUS_CLOSED) $colorseries[$status] = $badgeStatus6;
|
||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -140,13 +148,13 @@ if ($resql)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
$dolgraph->setHeight('200');
|
$dolgraph->setHeight('200');
|
||||||
$dolgraph->draw('idgraphstatus');
|
$dolgraph->draw('idgraphstatus');
|
||||||
print $dolgraph->show($total ? 0 : 1);
|
print $dolgraph->show($total ? 0 : 1);
|
||||||
$data = array('series'=>$dataseries);
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,6 +104,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// Note: billed or not is on another field "billed"
|
// Note: billed or not is on another field "billed"
|
||||||
public $statuts; // List of status
|
public $statuts; // List of status
|
||||||
|
|
||||||
|
public $billed;
|
||||||
|
|
||||||
public $socid;
|
public $socid;
|
||||||
public $fourn_id;
|
public $fourn_id;
|
||||||
public $date;
|
public $date;
|
||||||
@ -354,6 +356,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->socid = $obj->fk_soc;
|
$this->socid = $obj->fk_soc;
|
||||||
$this->fourn_id = $obj->fk_soc;
|
$this->fourn_id = $obj->fk_soc;
|
||||||
$this->statut = $obj->fk_statut;
|
$this->statut = $obj->fk_statut;
|
||||||
|
$this->status = $obj->fk_statut;
|
||||||
$this->billed = $obj->billed;
|
$this->billed = $obj->billed;
|
||||||
$this->user_author_id = $obj->fk_user_author;
|
$this->user_author_id = $obj->fk_user_author;
|
||||||
$this->user_valid_id = $obj->fk_user_valid;
|
$this->user_valid_id = $obj->fk_user_valid;
|
||||||
@ -694,7 +697,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* Return label of a status
|
* Return label of a status
|
||||||
*
|
*
|
||||||
* @param int $status Id statut
|
* @param int $status Id statut
|
||||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||||
* @param int $billed 1=Billed
|
* @param int $billed 1=Billed
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
@ -731,14 +734,14 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
$statustrans = array(
|
$statustrans = array(
|
||||||
0 => 'status0',
|
0 => 'status0',
|
||||||
1 => 'status1',
|
1 => 'status1b',
|
||||||
2 => 'status3',
|
2 => 'status1',
|
||||||
3 => 'status3',
|
3 => 'status4',
|
||||||
4 => 'status3',
|
4 => 'status4b',
|
||||||
5 => 'status4',
|
5 => 'status6',
|
||||||
6 => 'status5',
|
6 => 'status9',
|
||||||
7 => 'status5',
|
7 => 'status9',
|
||||||
9 => 'status5',
|
9 => 'status9',
|
||||||
);
|
);
|
||||||
|
|
||||||
$statusClass = 'status0';
|
$statusClass = 'status0';
|
||||||
@ -747,9 +750,10 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$billedtext = '';
|
$billedtext = '';
|
||||||
if ($mode == 4 && $billed) {
|
if ($billed) {
|
||||||
$billedtext = ' - '.$langs->trans("Billed");
|
$billedtext = ' - '.$langs->trans("Billed");
|
||||||
}
|
}
|
||||||
|
if ($status == 5 && $billed) $statusClass = 'status6';
|
||||||
|
|
||||||
$statusLong = $langs->trans($this->statuts[$status]).$billedtext;
|
$statusLong = $langs->trans($this->statuts[$status]).$billedtext;
|
||||||
$statusShort = $langs->trans($this->statutshort[$status]);
|
$statusShort = $langs->trans($this->statutshort[$status]);
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -605,7 +606,7 @@ class ProductFournisseur extends Product
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
|
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
|
||||||
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
|
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
|
||||||
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
|
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
|
||||||
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
|
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
|
||||||
$sql .= " pfp.barcode, pfp.fk_barcode_type";
|
$sql .= " pfp.barcode, pfp.fk_barcode_type";
|
||||||
@ -632,6 +633,7 @@ class ProductFournisseur extends Product
|
|||||||
|
|
||||||
$prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"];
|
$prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"];
|
||||||
$prodfourn->product_fourn_id = $record["product_fourn_id"];
|
$prodfourn->product_fourn_id = $record["product_fourn_id"];
|
||||||
|
$prodfourn->product_fourn_entity = $record["entity"];
|
||||||
$prodfourn->fourn_ref = $record["ref_fourn"];
|
$prodfourn->fourn_ref = $record["ref_fourn"];
|
||||||
$prodfourn->ref_supplier = $record["ref_fourn"];
|
$prodfourn->ref_supplier = $record["ref_fourn"];
|
||||||
$prodfourn->desc_supplier = $record["desc_fourn"];
|
$prodfourn->desc_supplier = $record["desc_fourn"];
|
||||||
|
|||||||
@ -1192,7 +1192,7 @@ if (empty($reshook))
|
|||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
|
||||||
{
|
{
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
$array_option = $lines[$i]->array_options;
|
$array_option = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1514,7 +1514,7 @@ if ($action == 'create')
|
|||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
|
|
||||||
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
$projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||||
|
|||||||
@ -76,12 +76,12 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
|||||||
* Statistics
|
* Statistics
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT count(cf.rowid), fk_statut";
|
$sql = "SELECT count(cf.rowid) as nb, fk_statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql .= " WHERE cf.fk_soc = s.rowid";
|
$sql .= " WHERE cf.fk_soc = s.rowid";
|
||||||
$sql .= " AND cf.entity = ".$conf->entity;
|
$sql .= " AND cf.entity IN (".getEntity('supplier_order').")";
|
||||||
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
|
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
$sql .= " GROUP BY cf.fk_statut";
|
$sql .= " GROUP BY cf.fk_statut";
|
||||||
@ -93,7 +93,6 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$totalinprocess = 0;
|
|
||||||
$dataseries = array();
|
$dataseries = array();
|
||||||
$vals = array();
|
$vals = array();
|
||||||
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
|
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
|
||||||
@ -101,27 +100,36 @@ if ($resql)
|
|||||||
// -> 6=Canceled -> (reopen) 2=Approved
|
// -> 6=Canceled -> (reopen) 2=Approved
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
if ($row[1] != 7 && $row[1] != 6 && $row[1] != 5)
|
$vals[($obj->status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER ? CommandeFournisseur::STATUS_CANCELED : $obj->status)] = $obj->nb;
|
||||||
{
|
|
||||||
$vals[$row[1]] = $row[0];
|
$total += $obj->nb;
|
||||||
$totalinprocess += $row[0];
|
|
||||||
}
|
|
||||||
$total += $row[0];
|
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
foreach (array(0, 1, 2, 3, 4, 5, 6) as $status)
|
$listofstatus=array(0, 1, 2, 3, 4, 5, 6, 9);
|
||||||
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($commandestatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
$dataseries[] = array($commandestatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
|
if ($status == CommandeFournisseur::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_VALIDATED) $colorseries[$status] = '-'.$badgeStatus1;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_ACCEPTED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_REFUSED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_ORDERSENT) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) $colorseries[$status] = '-'.$badgeStatus4;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $colorseries[$status] = $badgeStatus6;
|
||||||
|
if ($status == CommandeFournisseur::STATUS_CANCELED || $status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER) $colorseries[$status] = $badgeStatus9;
|
||||||
|
|
||||||
if (!$conf->use_javascript_ajax)
|
if (!$conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -137,6 +145,7 @@ if ($resql)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
@ -157,53 +166,6 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Legends / Status
|
|
||||||
*/
|
|
||||||
|
|
||||||
$sql = "SELECT count(cf.rowid) as nb, cf.fk_statut";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql .= " WHERE cf.fk_soc = s.rowid";
|
|
||||||
$sql .= " AND cf.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing
|
|
||||||
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
|
||||||
$sql .= " GROUP BY cf.fk_statut";
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table class="liste centpercent">';
|
|
||||||
|
|
||||||
print '<tr class="liste_titre"><th>'.$langs->trans("Status").'</th>';
|
|
||||||
print '<th class="right">'.$langs->trans("Nb").'</th>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td>'.$commandestatic->LibStatut($obj->nb).'</td>';
|
|
||||||
print '<td class="right"><a href="list.php?statut='.$obj->fk_statut.'">'.$obj->nb.' '.$commandestatic->LibStatut($obj->fk_statut, 3).'</a></td>';
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "</table></div><br>";
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draft orders
|
* Draft orders
|
||||||
*/
|
*/
|
||||||
@ -267,7 +229,7 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_T
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql .= " WHERE (u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE (u.entity IN (".getEntity('user')."))";
|
||||||
}
|
}
|
||||||
$sql .= " AND u.fk_soc IS NULL"; // An external user can not approved
|
$sql .= " AND u.fk_soc IS NULL"; // An external user can not approved
|
||||||
|
|
||||||
@ -322,7 +284,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
*/
|
*/
|
||||||
$max = 5;
|
$max = 5;
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.tms, s.nom as name, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -376,7 +338,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
|
||||||
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
print '<td class="right">'.$commandestatic->LibStatut($obj->status, 3, $obj->billed).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -905,6 +905,12 @@ if (empty($reshook))
|
|||||||
$objectsrc->fetch($originid);
|
$objectsrc->fetch($originid);
|
||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
|
if (!empty($object->origin) && !empty($object->origin_id))
|
||||||
|
{
|
||||||
|
$object->linkedObjectsIds[$object->origin] = $object->origin_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add also link with order if object is reception
|
||||||
if ($object->origin == 'reception')
|
if ($object->origin == 'reception')
|
||||||
{
|
{
|
||||||
$objectsrc->fetchObjectLinked();
|
$objectsrc->fetchObjectLinked();
|
||||||
@ -913,14 +919,10 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
foreach ($objectsrc->linkedObjectsIds['order_supplier'] as $key => $value)
|
foreach ($objectsrc->linkedObjectsIds['order_supplier'] as $key => $value)
|
||||||
{
|
{
|
||||||
$object->linked_objects['order_supplier'] = $value;
|
$object->linkedObjectsIds['order_supplier'] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (!empty($object->origin) && !empty($object->origin_id))
|
|
||||||
{
|
|
||||||
$object->linkedObjectsIds[$object->origin] = $object->origin_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
$id = $object->create($user);
|
$id = $object->create($user);
|
||||||
|
|
||||||
@ -950,7 +952,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
$lines[$i]->fetch_optionals();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dates
|
// Dates
|
||||||
@ -1750,7 +1752,7 @@ if ($action == 'create')
|
|||||||
$datedue = ($datetmp == '' ?-1 : $datetmp);
|
$datedue = ($datetmp == '' ?-1 : $datetmp);
|
||||||
|
|
||||||
// Replicate extrafields
|
// Replicate extrafields
|
||||||
$objectsrc->fetch_optionals($originid);
|
$objectsrc->fetch_optionals();
|
||||||
$object->array_options = $objectsrc->array_options;
|
$object->array_options = $objectsrc->array_options;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2077,7 +2079,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||||
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -918,7 +918,7 @@ if (empty($action) || $action == 'list')
|
|||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
// Lines for filters fields
|
// Lines for filters fields
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
@ -1019,9 +1019,9 @@ if (empty($action) || $action == 'list')
|
|||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="right">'.price($objp->pamount).'</td>';
|
print '<td class="right">'.price($objp->pamount).'</td>';
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'amount';
|
|
||||||
$totalarray['val']['amount'] += $objp->pamount;
|
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount';
|
||||||
|
$totalarray['val']['amount'] += $objp->pamount;
|
||||||
|
|
||||||
// Ref invoice
|
// Ref invoice
|
||||||
/*$invoicesupplierstatic->ref=$objp->ref_supplier;
|
/*$invoicesupplierstatic->ref=$objp->ref_supplier;
|
||||||
|
|||||||
@ -45,6 +45,7 @@ UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version
|
|||||||
|
|
||||||
|
|
||||||
-- For v12
|
-- For v12
|
||||||
|
DELETE FROM llx_menu where module='supplier_proposal';
|
||||||
|
|
||||||
UPDATE llx_website SET lang = 'en' WHERE lang like 'en_%';
|
UPDATE llx_website SET lang = 'en' WHERE lang like 'en_%';
|
||||||
UPDATE llx_website SET lang = 'fr' WHERE lang like 'fr_%';
|
UPDATE llx_website SET lang = 'fr' WHERE lang like 'fr_%';
|
||||||
@ -121,7 +122,7 @@ create table llx_object_lang
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
fk_object integer DEFAULT 0 NOT NULL,
|
fk_object integer DEFAULT 0 NOT NULL,
|
||||||
type_object varchar(32) NOT NULL,
|
type_object varchar(32) NOT NULL, -- value found into $object->element
|
||||||
property varchar(32) NOT NULL,
|
property varchar(32) NOT NULL,
|
||||||
lang varchar(5) DEFAULT 0 NOT NULL,
|
lang varchar(5) DEFAULT 0 NOT NULL,
|
||||||
value text,
|
value text,
|
||||||
@ -198,3 +199,7 @@ ALTER TABLE llx_entrepot ADD COLUMN phone varchar(20) DEFAULT NULL;
|
|||||||
|
|
||||||
ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active;
|
ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active;
|
||||||
|
|
||||||
|
ALTER TABLE llx_categorie MODIFY type integer NOT NULL DEFAULT 1;
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_remise_except ADD COLUMN vat_src_code varchar(10) DEFAULT '';
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ create table llx_categorie
|
|||||||
fk_parent integer DEFAULT 0 NOT NULL,
|
fk_parent integer DEFAULT 0 NOT NULL,
|
||||||
label varchar(180) NOT NULL, -- category ref/name
|
label varchar(180) NOT NULL, -- category ref/name
|
||||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||||
type tinyint DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member)
|
type integer DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member)
|
||||||
description text, -- description of the category
|
description text, -- description of the category
|
||||||
color varchar(8), -- color
|
color varchar(8), -- color
|
||||||
fk_soc integer DEFAULT NULL, -- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set.
|
fk_soc integer DEFAULT NULL, -- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set.
|
||||||
|
|||||||
@ -31,7 +31,7 @@ create table llx_commande_fournisseur_dispatch
|
|||||||
fk_entrepot integer,
|
fk_entrepot integer,
|
||||||
fk_user integer,
|
fk_user integer,
|
||||||
comment varchar(255), -- comment on movement
|
comment varchar(255), -- comment on movement
|
||||||
batch varchar(30) DEFAULT NULL,
|
batch varchar(128) DEFAULT NULL,
|
||||||
eatby date DEFAULT NULL,
|
eatby date DEFAULT NULL,
|
||||||
sellby date DEFAULT NULL,
|
sellby date DEFAULT NULL,
|
||||||
status integer,
|
status integer,
|
||||||
|
|||||||
@ -20,7 +20,7 @@ CREATE TABLE llx_expeditiondet_batch (
|
|||||||
fk_expeditiondet int NOT NULL,
|
fk_expeditiondet int NOT NULL,
|
||||||
eatby date DEFAULT NULL,
|
eatby date DEFAULT NULL,
|
||||||
sellby date DEFAULT NULL,
|
sellby date DEFAULT NULL,
|
||||||
batch varchar(30) DEFAULT NULL,
|
batch varchar(128) DEFAULT NULL,
|
||||||
qty double NOT NULL DEFAULT '0',
|
qty double NOT NULL DEFAULT '0',
|
||||||
fk_origin_stock integer NOT NULL
|
fk_origin_stock integer NOT NULL
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ tms timestamp,
|
|||||||
fk_inventory integer DEFAULT 0,
|
fk_inventory integer DEFAULT 0,
|
||||||
fk_warehouse integer DEFAULT 0,
|
fk_warehouse integer DEFAULT 0,
|
||||||
fk_product integer DEFAULT 0,
|
fk_product integer DEFAULT 0,
|
||||||
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
batch varchar(128) DEFAULT NULL, -- Lot or serial number
|
||||||
qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition
|
qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition
|
||||||
qty_view double DEFAULT NULL, -- must be filled once regulation is done
|
qty_view double DEFAULT NULL, -- must be filled once regulation is done
|
||||||
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
|
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
|
||||||
|
|||||||
@ -23,7 +23,7 @@ CREATE TABLE llx_mrp_production(
|
|||||||
qty real NOT NULL DEFAULT 1,
|
qty real NOT NULL DEFAULT 1,
|
||||||
qty_frozen smallint DEFAULT 0,
|
qty_frozen smallint DEFAULT 0,
|
||||||
disable_stock_change smallint DEFAULT 0,
|
disable_stock_change smallint DEFAULT 0,
|
||||||
batch varchar(30),
|
batch varchar(128),
|
||||||
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
|
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
|
||||||
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
|
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
|
||||||
fk_stock_movement integer, -- id of stock movement when movements are validated
|
fk_stock_movement integer, -- id of stock movement when movements are validated
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user