Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
Browse files Browse the repository at this point in the history
develop_dict

Conflicts:
	htdocs/install/mysql/migration/6.0.0-7.0.0.sql
  • Loading branch information
hregis committed Sep 14, 2017
2 parents b5de8da + fd76023 commit a494e01
Show file tree
Hide file tree
Showing 143 changed files with 3,132 additions and 1,302 deletions.
45 changes: 29 additions & 16 deletions .travis.yml
Expand Up @@ -2,19 +2,15 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/

# We use dist: precise to have php 5.3 available
dist: precise
sudo: required

language: php

php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- nightly
# Start on every boot
services:
- memcached

addons:
mariadb: '10.0'
Expand All @@ -33,10 +29,16 @@ addons:
- libapache2-mod-fastcgi
# We need pgloader for import mysql database into pgsql
- pgloader

# Start on every boot
services:
- memcached

php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
#- hhvm only with dist: trusty
- nightly

env:
global:
Expand All @@ -57,11 +59,22 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: 7.1
- php: hhvm
- php: nightly
#- env: DB=postgresql
# TODO
#- env: DB=sqlite
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=postgresql
- php: '5.5'
env: DB=postgresql
- php: '5.6'
env: DB=postgresql
- php: '7.0'
env: DB=postgresql
- php: hhvm
env: DB=postgresql
- php: nightly
env: DB=postgresql

notifications:
email:
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -162,6 +162,9 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint".

***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files.

***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document
Expand Down
6 changes: 3 additions & 3 deletions htdocs/accountancy/admin/journals_list.php
Expand Up @@ -490,7 +490,7 @@

if (empty($reshook))
{
fieldList($fieldlist,$obj,$tabname[$id],'add');
fieldListJournal($fieldlist,$obj,$tabname[$id],'add');
}

print '<td colspan="4" align="right">';
Expand Down Expand Up @@ -595,7 +595,7 @@
$error=$hookmanager->error; $errors=$hookmanager->errors;

// Show fields
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit');

print '<td align="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
Expand Down Expand Up @@ -713,7 +713,7 @@
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
function fieldList($fieldlist, $obj='', $tabname='', $context='')
function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
global $form, $mysoc;
Expand Down
25 changes: 18 additions & 7 deletions htdocs/accountancy/bookkeeping/balance.php
Expand Up @@ -28,7 +28,9 @@

// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';

Expand All @@ -51,9 +53,8 @@
$search_accountancy_code_end = '';
}

if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv.x") || GETPOST("button_export_csv")) {
$action = 'export_csv';
}
if (GETPOST("exportcsv")) $action = 'export_csv';


$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;

Expand All @@ -66,8 +67,18 @@
$form = new Form($db);

if (empty($search_date_start)) {
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));

$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$year_start = dol_print_date(dol_now(), '%Y');
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
{
$month_end = 12;
$year_end--;
}
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$search_date_end = dol_get_last_day($year_end, $month_end);
}
if ($sortorder == "")
$sortorder = "ASC";
Expand Down Expand Up @@ -136,7 +147,7 @@
}

else {
$title_page = $langs->trans("AccountBalance") . (($search_date_start || $search_date_end) ? ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end) : '');
$title_page = $langs->trans("AccountBalance");

llxHeader('', $title_page);

Expand All @@ -156,7 +167,7 @@

print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

$button = '<input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button);

$moreforfilter = '';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/class/accountancycategory.class.php
Expand Up @@ -354,7 +354,7 @@ public function getResult($cpt, $month, $date_start, $date_end, $sens, $thirdpar
}
if ($thirdparty_code != 'nofilter')
{
$sql .= " AND thirdparty_code = '".$ths->db->escape($thirdparty_code)."'";
$sql .= " AND thirdparty_code = '".$this->db->escape($thirdparty_code)."'";
}

dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG);
Expand Down
89 changes: 54 additions & 35 deletions htdocs/accountancy/customer/index.php
Expand Up @@ -108,29 +108,6 @@
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();

$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';

dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);

$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
Expand All @@ -144,7 +121,7 @@
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";

dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);

$resql1 = $db->query($sql1);
if (! $resql1) {
Expand All @@ -169,13 +146,29 @@

print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');

// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database

print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';

$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
Expand Down Expand Up @@ -214,8 +207,8 @@
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';

$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
Expand All @@ -241,8 +234,20 @@

while ( $row = $db->fetch_row($resql)) {

print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
Expand Down Expand Up @@ -271,8 +276,8 @@
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';

$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
Expand All @@ -298,7 +303,20 @@

while ( $row = $db->fetch_row($resql)) {

print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
Expand Down Expand Up @@ -367,6 +385,7 @@
print "</table>\n";
print '</div>';


if (! empty($conf->margin->enabled)) {
print "<br>\n";
print '<div class="div-table-responsive-no-min">';
Expand Down

0 comments on commit a494e01

Please sign in to comment.