Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
5d76227948
@ -1,16 +0,0 @@
|
||||
build
|
||||
build.xml
|
||||
ChangeLog
|
||||
composer.json
|
||||
CONTRIBUTING.md
|
||||
COPYING
|
||||
COPYRIGHT
|
||||
dev
|
||||
doc
|
||||
Dockerfile
|
||||
INSTALL
|
||||
README-FR.md
|
||||
README.md
|
||||
robots.txt
|
||||
scripts
|
||||
test
|
||||
3
build/docker/.dockerignore
Normal file
3
build/docker/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
Dockerfile
|
||||
README.md
|
||||
docker-compose.yml
|
||||
@ -1,4 +1,7 @@
|
||||
FROM php:5.6-apache
|
||||
FROM php:7.0-apache
|
||||
|
||||
ENV HOST_USER_ID 33
|
||||
ENV PHP_INI_DATE_TIMEZONE 'UTC'
|
||||
|
||||
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
@ -9,11 +12,9 @@ RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
||||
|
||||
COPY htdocs/ /var/www/html/
|
||||
|
||||
RUN chown -hR www-data:www-data /var/www/html
|
||||
|
||||
VOLUME /var/www/html/conf
|
||||
VOLUME /var/www/html/documents
|
||||
COPY docker-run.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-run.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["docker-run.sh"]
|
||||
25
build/docker/README.md
Normal file
25
build/docker/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
# How to use it ?
|
||||
|
||||
The docker-compose.yml file is used to build and run Dolibarr in the current workspace.
|
||||
|
||||
Before build/run, define the variable HOST_USER_ID as following:
|
||||
|
||||
export HOST_USER_ID=$(id -u)
|
||||
|
||||
Go in repository build/docker :
|
||||
|
||||
cd build/docker
|
||||
|
||||
And then, you can run :
|
||||
|
||||
docker-compose up
|
||||
|
||||
This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin.
|
||||
|
||||
The URL to go to the Dolibarr is :
|
||||
|
||||
http://0.0.0.0
|
||||
|
||||
The URL to go to PhpMyAdmin is (login/password is root/root) :
|
||||
|
||||
http://0.0.0.0:8080
|
||||
25
build/docker/docker-compose.yml
Normal file
25
build/docker/docker-compose.yml
Normal file
@ -0,0 +1,25 @@
|
||||
mariadb:
|
||||
image: mariadb:latest
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: dolibarr
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
environment:
|
||||
PMA_HOST: mariadb
|
||||
links:
|
||||
- mariadb
|
||||
ports:
|
||||
- "8080:80"
|
||||
|
||||
web:
|
||||
build: .
|
||||
environment:
|
||||
HOST_USER_ID: $HOST_USER_ID
|
||||
volumes:
|
||||
- ../../htdocs:/var/www/html
|
||||
links:
|
||||
- mariadb
|
||||
ports:
|
||||
- "80:80"
|
||||
15
build/docker/docker-run.sh
Normal file
15
build/docker/docker-run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
usermod -u $HOST_USER_ID www-data
|
||||
groupmod -g $HOST_USER_ID www-data
|
||||
|
||||
chown -hR www-data:www-data /var/www
|
||||
|
||||
if [ ! -f /usr/local/etc/php/php.ini ]; then
|
||||
cat <<EOF > /usr/local/etc/php/php.ini
|
||||
date.timezone = $PHP_INI_DATE_TIMEZONE
|
||||
display_errors = On
|
||||
EOF
|
||||
fi
|
||||
|
||||
exec apache2-foreground
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
@ -21,15 +22,14 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/bank.php
|
||||
* \ingroup bank
|
||||
* \brief Page to setup the bank module
|
||||
* \ingroup bank
|
||||
* \brief Page to setup the bank module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
@ -38,12 +38,12 @@ $langs->load("other");
|
||||
$langs->load("banks");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'bankaccount';
|
||||
|
||||
|
||||
@ -52,100 +52,109 @@ $type = 'bankaccount';
|
||||
*/
|
||||
|
||||
//Order display of bank account
|
||||
if ($action == 'setbankorder')
|
||||
{
|
||||
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
if ($action == 'setbankorder') {
|
||||
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",
|
||||
GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
//Auto report last num releve on conciliate
|
||||
if ($action == 'setreportlastnumreleve') {
|
||||
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0,
|
||||
'', $conf->entity) > 0) {
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
elseif ($action == 'unsetreportlastnumreleve') {
|
||||
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0,
|
||||
'', $conf->entity) > 0) {
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
if ($modele == 'sepamandate')
|
||||
{
|
||||
if ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
if ($modele == 'sepamandate') {
|
||||
$object = new CompanyBankAccount($db);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object = new Account($db);
|
||||
}
|
||||
$object->initAsSpecimen();
|
||||
|
||||
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php",
|
||||
0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_" . $modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
|
||||
if ($filefound) {
|
||||
require_once $file;
|
||||
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($object,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
||||
|
||||
if ($module->write_file($object, $langs) > 0) {
|
||||
header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=bank&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($module->error, null, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
if ($action == 'set') {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->BANKADDON_PDF == "$value") dolibarr_del_const($db, 'BANKADDON_PDF',$conf->entity);
|
||||
}
|
||||
else if ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->BANKADDON_PDF == "$value")
|
||||
dolibarr_del_const($db, 'BANKADDON_PDF', $conf->entity);
|
||||
}
|
||||
}
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "BANKADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
else if ($action == 'setdoc') {
|
||||
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
||||
$conf->entity)) {
|
||||
// The constant that was read before the new set
|
||||
// We therefore requires a variable to have a coherent view
|
||||
$conf->global->BANKADDON_PDF = $value;
|
||||
}
|
||||
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
@ -156,80 +165,78 @@ else if ($action == 'setdoc')
|
||||
* view
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader("",$langs->trans("BankSetupModule"));
|
||||
llxHeader("", $langs->trans("BankSetupModule"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup');
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback,
|
||||
'title_setup');
|
||||
|
||||
$head = bank_admin_prepare_head(null);
|
||||
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
||||
|
||||
$var=true;
|
||||
$var = true;
|
||||
|
||||
$var=! $var;
|
||||
$var = !$var;
|
||||
|
||||
//Show bank account order
|
||||
print load_fiche_titre($langs->trans("BankOrderShow"), '', '');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Status").'</td>';
|
||||
print '<td width="140">' . $langs->trans("Name") . '</td>';
|
||||
print '<td>' . $langs->trans("Description") . '</td>';
|
||||
print '<td>' . $langs->trans("Example") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("Status") . '</td>';
|
||||
print '<td align="center" width="60"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$bankorder[0][0]=$langs->trans("BankOrderGlobal");
|
||||
$bankorder[0][1]=$langs->trans("BankOrderGlobalDesc");
|
||||
$bankorder[0][2]='BankCode DeskCode BankAccountNumber BankAccountNumberKey';
|
||||
$bankorder[1][0]=$langs->trans("BankOrderES");
|
||||
$bankorder[1][1]=$langs->trans("BankOrderESDesc");
|
||||
$bankorder[1][2]='BankCode DeskCode BankAccountNumberKey BankAccountNumber';
|
||||
$bankorder[0][0] = $langs->trans("BankOrderGlobal");
|
||||
$bankorder[0][1] = $langs->trans("BankOrderGlobalDesc");
|
||||
$bankorder[0][2] = 'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
|
||||
$bankorder[1][0] = $langs->trans("BankOrderES");
|
||||
$bankorder[1][1] = $langs->trans("BankOrderESDesc");
|
||||
$bankorder[1][2] = 'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
|
||||
|
||||
$var = true;
|
||||
$i=0;
|
||||
$i = 0;
|
||||
|
||||
$nbofbank=count($bankorder);
|
||||
while ($i < $nbofbank)
|
||||
{
|
||||
$var = !$var;
|
||||
$nbofbank = count($bankorder);
|
||||
while ($i < $nbofbank) {
|
||||
$var = !$var;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$bankorder[$i][0]."</td><td>\n";
|
||||
print $bankorder[$i][1];
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
$tmparray=explode(' ',$bankorder[$i][2]);
|
||||
foreach($tmparray as $key => $val)
|
||||
{
|
||||
if ($key > 0) print ', ';
|
||||
print $langs->trans($val);
|
||||
}
|
||||
print "</td>\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $bankorder[$i][0] . "</td><td>\n";
|
||||
print $bankorder[$i][1];
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
$tmparray = explode(' ', $bankorder[$i][2]);
|
||||
foreach ($tmparray as $key => $val) {
|
||||
if ($key > 0)
|
||||
print ', ';
|
||||
print $langs->trans($val);
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print img_picto($langs->trans("Activated"),'on');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&value='.$i.'">';
|
||||
print img_picto($langs->trans("Disabled"),'off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
|
||||
print '<td align="center">';
|
||||
print img_picto($langs->trans("Activated"), 'on');
|
||||
print '</td>';
|
||||
}
|
||||
else {
|
||||
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&value=' . $i . '">';
|
||||
print img_picto($langs->trans("Disabled"), 'off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
print '</tr>' . "\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</table>' . "\n";
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
@ -257,7 +264,8 @@ if ($resql) {
|
||||
array_push($def, $array[0]);
|
||||
$i ++;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -273,11 +281,10 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach ($dirmodels as $reldir) {
|
||||
foreach (array('', '/doc') as $valdir) {
|
||||
$dir = dol_buildpath($reldir . "core/modules/bank" . $valdir);
|
||||
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
@ -286,23 +293,26 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/',
|
||||
$file)) {
|
||||
|
||||
if (file_exists($dir . '/' . $file)) {
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
|
||||
require_once $dir . '/' . $file;
|
||||
$module = new $classname($db);
|
||||
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL
|
||||
< 2)
|
||||
$modulequalified = 0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL
|
||||
< 1)
|
||||
$modulequalified = 0;
|
||||
|
||||
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print(empty($module->name) ? $name : $module->name);
|
||||
@ -312,29 +322,35 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print img_picto($langs->trans("Enabled"),
|
||||
'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
|
||||
'switch_off') . '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
|
||||
// Default
|
||||
print '<td align="center">';
|
||||
if ($conf->global->BANKADDON_PDF == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||
print img_picto($langs->trans("Default"),
|
||||
'on');
|
||||
}
|
||||
else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"),
|
||||
'off') . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Info
|
||||
$htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
|
||||
$htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
@ -342,27 +358,33 @@ foreach ($dirmodels as $reldir)
|
||||
$htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
|
||||
}
|
||||
$htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
|
||||
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
|
||||
$htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo,
|
||||
1, 1);
|
||||
//$htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
|
||||
//$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
|
||||
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
|
||||
$htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang,
|
||||
1, 1);
|
||||
// $htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
|
||||
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print $form->textwithpicto('', $htmltooltip, 1,
|
||||
0);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Preview
|
||||
print '<td align="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'bill') . '</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
|
||||
'bill') . '</a>';
|
||||
}
|
||||
else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"),
|
||||
'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
@ -372,9 +394,51 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
//}
|
||||
|
||||
|
||||
|
||||
print '<br /><br />';
|
||||
|
||||
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
//{
|
||||
print load_fiche_titre($langs->trans("BankAccountReleveModule"), '', '');
|
||||
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>' . $langs->trans("Name") . '</td>';
|
||||
print '<td>' . $langs->trans("Description") . '</td>';
|
||||
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print $langs->trans('AccountStatement');
|
||||
print "</td><td>\n";
|
||||
print $langs->trans('AutoReportLastAccountStatement');
|
||||
print '</td>';
|
||||
// Active
|
||||
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),
|
||||
'switch_off') . '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -605,7 +605,7 @@ if ($resql)
|
||||
// print '<td>';
|
||||
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
||||
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
||||
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
||||
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
||||
print '</div>';
|
||||
if ($options) {
|
||||
print $langs->trans("EventualyAddCategory").': ';
|
||||
@ -649,6 +649,16 @@ if ($resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
/**
|
||||
* Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
|
||||
*/
|
||||
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE == 1) {
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
$("#num_releve").val("' . $last_releve . '");
|
||||
</script>
|
||||
';
|
||||
}
|
||||
print '<br><br>';
|
||||
// print '</td></tr></table>';
|
||||
}
|
||||
@ -1117,7 +1127,16 @@ if ($resql)
|
||||
// Date ope
|
||||
if (! empty($arrayfields['b.dateo']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
||||
print '<td align="center" class="nowrap">';
|
||||
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do),"day")."</span>";
|
||||
print ' ';
|
||||
print '<span class="inline-block">';
|
||||
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=doprev&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_remove() . "</a> ";
|
||||
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=donext&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_add() ."</a>";
|
||||
print '</span>';
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@ -1959,6 +1959,67 @@ class AccountLine extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Increase/decrease operation date of a rowid
|
||||
*
|
||||
* @param int $rowid Id of line
|
||||
* @param int $sign 1 or -1
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
function dateo_change($rowid,$sign=1)
|
||||
{
|
||||
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$this->db->fetch_object($resql);
|
||||
$newdate=$this->db->jdate($obj->dateo)+(3600*24*$sign);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET";
|
||||
$sql.= " dateo = '".$this->db->idate($newdate)."'";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->affected_rows($result))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase operation date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
function dateo_next($id)
|
||||
{
|
||||
return $this->dateo_change($id,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrease operation date of a rowid
|
||||
*
|
||||
* @param int $id Id of line to change
|
||||
* @return int >0 if OK, 0 if KO
|
||||
*/
|
||||
function dateo_previous($id)
|
||||
{
|
||||
return $this->dateo_change($id,-1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load miscellaneous information for tab "Info"
|
||||
*
|
||||
|
||||
@ -71,13 +71,20 @@ if ($cancel)
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->banque->consolidate && $action == 'dvnext')
|
||||
|
||||
if ($user->rights->banque->consolidate && $action == 'donext')
|
||||
{
|
||||
$al = new AccountLine($db);
|
||||
$al->dateo_next($_GET["rowid"]);
|
||||
}elseif ($user->rights->banque->consolidate && $action == 'doprev')
|
||||
{
|
||||
$al = new AccountLine($db);
|
||||
$al->dateo_previous($_GET["rowid"]);
|
||||
}elseif ($user->rights->banque->consolidate && $action == 'dvnext')
|
||||
{
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_next($_GET["rowid"]);
|
||||
}
|
||||
|
||||
if ($user->rights->banque->consolidate && $action == 'dvprev')
|
||||
}elseif ($user->rights->banque->consolidate && $action == 'dvprev')
|
||||
{
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_previous($_GET["rowid"]);
|
||||
@ -479,6 +486,14 @@ if ($result)
|
||||
{
|
||||
print '<td>';
|
||||
print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
|
||||
if (! $objp->rappro)
|
||||
{
|
||||
print ' ';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=doprev&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_remove() . "</a> ";
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=donext&id='.$id.'&rowid='.$objp->rowid.'">';
|
||||
print img_edit_add() ."</a>";
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -71,3 +71,27 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
|
||||
{
|
||||
// Increase date
|
||||
$al = new AccountLine($db);
|
||||
$al->dateo_next(GETPOST('rowid','int'));
|
||||
$al->fetch(GETPOST('rowid','int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
|
||||
{
|
||||
// Decrease date
|
||||
$al =new AccountLine($db);
|
||||
$al->dateo_previous(GETPOST('rowid','int'));
|
||||
$al->fetch(GETPOST('rowid','int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->dateo),"day").'</span>';
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -67,21 +67,29 @@ elseif ($module == 'product') { $permission=$user->rights->produit->creer;
|
||||
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note.
|
||||
else $typeofdata='textarea:12:95%';
|
||||
|
||||
print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n";
|
||||
print '<div class="tagtable border table-border centpercent">'."\n";
|
||||
if ($module != 'product') {
|
||||
// No public note yet on products
|
||||
print '<div class="tagtr table-border-row">'."\n";
|
||||
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'">'."\n";
|
||||
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
|
||||
print '</div>'."\n";
|
||||
print '<div class="tagtd table-val-border-col">'."\n";
|
||||
print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
|
||||
print '</div>'."\n";
|
||||
print '</div>'."\n";
|
||||
}
|
||||
if (empty($user->societe_id)) {
|
||||
print '<div class="tagtr table-border-row">'."\n";
|
||||
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass); .'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'">'."\n";
|
||||
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
|
||||
print '</div>'."\n";
|
||||
print '<div class="tagtd table-val-border-col">'."\n";
|
||||
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
|
||||
print '</div>'."\n";
|
||||
print '</div>'."\n";
|
||||
}
|
||||
print '</div>'."\n";
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE NOTES -->
|
||||
<div class="tagtable border table-border centpercent">
|
||||
<?php if ($module != 'product') { // No public note yet on products ?>
|
||||
<div class="tagtr table-border-row">
|
||||
<div class="tagtd tdtop table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if (empty($user->societe_id)) { ?>
|
||||
<div class="tagtr table-border-row">
|
||||
<div class="tagtd tdtop table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?></div>
|
||||
<div class="tagtd table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- END PHP TEMPLATE NOTES-->
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,16 +19,20 @@
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td><?php echo $this->tpl['label']; ?></td>
|
||||
<td><?php echo $this->tpl['description']; ?></td>
|
||||
<td align="right"><?php echo $this->tpl['vat_rate']; ?></td>
|
||||
<td align="right"><?php echo $this->tpl['price']; ?></td>
|
||||
<?php if (!empty($conf->multicurrency->enabled)) { ?><td align="right"><?php echo $this->tpl['multicurrency_price']; ?></td><?php } ?>
|
||||
<td align="right"><?php echo $this->tpl['qty']; ?></td>
|
||||
<?php
|
||||
if($conf->global->PRODUCT_USE_UNITS) echo '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>';
|
||||
?>
|
||||
<td align="right"><?php echo $this->tpl['remise_percent']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
print '<tr'.$bc[$var].'>';
|
||||
print '<td>'.$this->tpl['label'].'</td>';
|
||||
print '<td>'.$this->tpl['description'].'</td>';
|
||||
print '<td align="right">'.$this->tpl['vat_rate'].'</td>';
|
||||
print '<td align="right">'.$this->tpl['price'].'</td>';
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>';
|
||||
|
||||
print '<td align="right">'.$this->tpl['qty'].'</td>';
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>';
|
||||
|
||||
print '<td align="right">'.$this->tpl['remise_percent'].'</td>';
|
||||
print '</tr>'."\n";
|
||||
?>
|
||||
<!-- END PHP TEMPLATE originproductline.tpl.php -->
|
||||
|
||||
@ -18,3 +18,5 @@ RejectCheck=Cheque returned
|
||||
RejectCheckDate=Date the cheque was returned
|
||||
CheckRejected=Cheque returned
|
||||
CheckRejectedAndInvoicesReopened=Cheque returned and invoices reopened
|
||||
AutoReportLastAccountStatement=Use automatically last account statement to reconcile
|
||||
BankAccountReleveModule=Bank Statement
|
||||
@ -38,6 +38,9 @@ AccountStatement=Relevé
|
||||
AccountStatementShort=Relevé
|
||||
AccountStatements=Relevés
|
||||
LastAccountStatements=Derniers relevés bancaires
|
||||
AutoReportLastAccountStatement=Proposer automatiquement le dernier relevé bancaire rapproché
|
||||
BankAccountReleveModule=Rapprochement relevés bancaires
|
||||
Conciliated=Rapproché
|
||||
IOMonthlyReporting=Rapport mensuel E/S
|
||||
BankAccountDomiciliation=Domiciliation du compte
|
||||
BankAccountCountry=Pays du compte
|
||||
|
||||
Loading…
Reference in New Issue
Block a user