Skip to content

Commit

Permalink
Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe-opendsi committed May 21, 2018
2 parents cbf12b7 + 7de812d commit 4d72573
Show file tree
Hide file tree
Showing 66 changed files with 578 additions and 483 deletions.
Empty file modified .gitignore 100755 → 100644
Empty file.
50 changes: 50 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,56 @@
English Dolibarr ChangeLog
--------------------------------------------------------------


***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
FIX: #8478 !empty instead of count to avoid warning
FIX: #8488
FIX: actioncomm export: type filtering not working
FIX: addline on invoice supplier manage rank on its own if not provided
FIX: issue #8037
FIX: label in getnomurl projectlist
FIX: payment term doc-specific label was not used
FIX: payment term doc-specific label was not used (issue #8414)
FIX: project category is type 6 not 5 !!
FIX: some localtaxes errors
FIX: weird password autocompletion in Google Chrome (issue #8479)

***** ChangeLog for 6.0.6 compared to 6.0.5 *****
FIX: #7974 Contract - Invalid reference on the document
FIX: #8139
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
FIX: #8151
FIX: #8200
FIX: add planned delivery to order exports
FIX: a discount is a percent, not an amount, so we use vatrate not price
FIX: Avoid empty value to fk_multicurrency attribute
FIX: Bad localtaxes assignment in cashdesk
FIX: check shipping on delete order
FIX: check verif exped on delete order
FIX: creer into lire
FIX: Delete tasks on project delete will now trigger TASK_DELETE
FIX: Global on $user parameter reset the variable
FIX: if we make a mistake with situation_percent, now we can correct…
FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back
FIX: Import process must stop after ending line nb to import
FIX: migration script for product photo
FIX: natural search double quote
FIX: reverse field to have object loaded in doaction
FIX: Saving wrong localtax on order addline
FIX: show status on societe banner
FIX: solve column mismatch in user card's usergroup list + code cleanup
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
FIX: unset categorie
FIX: update_extras on fourn card
FIX: warning when adding ECM files using old photo path
FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page
NEW: Add sale representative einstein_pdf_modules
NEW_einstein_pdf_modules
NEW: field commerciaux and categ export CustomersInvoicesAndPayments


***** ChangeLog for 6.0.5 compared to 6.0.4 *****
FIX: security vulnerability reported by ADLab of Venustech
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900
Expand Down
11 changes: 7 additions & 4 deletions build/makepack-dolibarr.pl
Expand Up @@ -466,10 +466,12 @@
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
Expand Down Expand Up @@ -849,6 +851,8 @@
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz");
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");

Expand Down Expand Up @@ -1024,7 +1028,7 @@
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next;
}
Expand Down Expand Up @@ -1168,7 +1172,7 @@
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
Expand All @@ -1181,8 +1185,7 @@
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
Expand Down
50 changes: 25 additions & 25 deletions htdocs/accountancy/admin/account.php
Expand Up @@ -94,9 +94,9 @@
if (empty($reshook))
{
if (! empty($cancel)) $action = '';

include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';

if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_account = "";
Expand All @@ -106,26 +106,26 @@
$search_pcgsubtype = "";
$search_array_options=array();
}

if (GETPOST('change_chart'))
{
$chartofaccounts = GETPOST('chartofaccounts', 'int');

if (! empty($chartofaccounts)) {

if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
} else {
$error ++;
}
}

if ($action == 'disable') {
if ($accounting->fetch($id)) {
$result = $accounting->account_desactivate($id);
}

$action = 'update';
if ($result < 0) {
setEventMessages($accounting->error, $accounting->errors, 'errors');
Expand Down Expand Up @@ -160,10 +160,10 @@
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity;
// Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)";
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER) AND a2.entity = " . $conf->entity;
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED) AND a2.entity = " . $conf->entity;
$sql .= " WHERE asy.rowid = " . $pcgver;

if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
Expand All @@ -179,7 +179,7 @@
{
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
}
}

$sql .= $db->plimit($limit + 1, $offset);

Expand Down Expand Up @@ -209,11 +209,11 @@
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';

$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';

print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);

// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
Expand All @@ -227,22 +227,22 @@
$i = 0;
while ( $i < $numbis ) {
$row = $db->fetch_row($resqlchart);

print '<option value="' . $row[0] . '"';
print $pcgver == $row[0] ? ' selected' : '';
print '>' . $row[1] . ' - ' . $row[2] . '</option>';

$i ++;
}
}
print "</select>";
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<br>';
print '<br>';
print '<br>';

$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields

print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";

Expand All @@ -259,7 +259,7 @@
print $searchpicto;
print '</td>';
print '</tr>';

print '<tr class="liste_titre">';
if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
Expand All @@ -274,14 +274,14 @@
$accountparent = new AccountingAccount($db);

$i=0;
while ($i < min($num, $limit))
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($resql);

$accountstatic->id = $obj->rowid;
$accountstatic->label = $obj->label;
$accountstatic->account_number = $obj->account_number;

print '<tr class="oddeven">';

// Account number
Expand Down Expand Up @@ -310,7 +310,7 @@
$accountparent->id = $obj->rowid2;
$accountparent->label = $obj->label2;
$accountparent->account_number = $obj->account_number2;

print "<td>";
print $accountparent->getNomUrl(1);
print "</td>\n";
Expand Down Expand Up @@ -371,11 +371,11 @@
}
print '</td>' . "\n";
if (! $i) $totalarray['nbfield']++;

print "</tr>\n";
$i++;
}

print "</table>";
print "</div>";
print '</form>';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/admin/journals_list.php
Expand Up @@ -86,7 +86,7 @@

// Requests to extract data
$tabsql=array();
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a";
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity;

// Criteria to sort dictionaries
$tabsqlsort=array();
Expand All @@ -102,7 +102,7 @@

// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array();
$tabfieldinsert[35]= "code,label,nature";
$tabfieldinsert[35]= "code,label,nature,entity";

// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on
Expand Down
2 changes: 2 additions & 0 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 Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/customer/lines.php
Expand Up @@ -152,7 +152,7 @@
/*
* Customer Invoice lines
*/
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql = "SELECT f.rowid as factid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
Expand Down Expand Up @@ -302,7 +302,7 @@
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;

$facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->rowid;
$facture_static->id = $objp->factid;

$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
Expand Down
6 changes: 3 additions & 3 deletions htdocs/accountancy/journal/expensereportsjournal.php
Expand Up @@ -135,9 +135,9 @@
$compta_fees = $obj->compte;

$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0);
$compta_tva = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $account_vat);
$compta_localtax1 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
$compta_localtax2 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
$compta_tva = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat);
$compta_localtax1 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
$compta_localtax2 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);

// Define array to display all VAT rates that use this accounting account $compta_tva
if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -164,7 +164,7 @@
// Situation invoices handling
$line = new FactureLigne($db);
$line->fetch($obj->fdid);
$prev_progress = $line->get_prev_progress($obj->fdid);
$prev_progress = $line->get_prev_progress($obj->rowid);
if ($obj->type == Facture::TYPE_SITUATION) {
// Avoid divide by 0
if ($obj->situation_percent == 0) {
Expand Down
4 changes: 3 additions & 1 deletion htdocs/cashdesk/facturation_verif.php
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -150,7 +151,8 @@
$obj_facturation->id($ret['rowid']);
$obj_facturation->ref($ret['ref']);
$obj_facturation->stock($ret['reel']);
$obj_facturation->prix($ret['price']);
//$obj_facturation->prix($ret['price']);
$obj_facturation->prix($pu_ht);


$vatrate = $tva_tx;
Expand Down
10 changes: 8 additions & 2 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -3126,7 +3126,13 @@ function delete($user, $notrigger=0)
if ($result < 0) $error++;
// End call triggers
}


if ($this->nb_expedition() != 0)
{
$this->errors[] = $langs->trans('SomeShipmentExists');
$error++;
}

//TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail
if (! $error)
{
Expand Down Expand Up @@ -4034,7 +4040,7 @@ function insert($user=null, $notrigger=0)
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);
$sql.= ", ".$this->fk_multicurrency;
$sql.= ", ".(! empty($this->fk_multicurrency) ? $this->fk_multicurrency : 'NULL');
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".$this->multicurrency_subprice;
$sql.= ", ".$this->multicurrency_total_ht;
Expand Down

0 comments on commit 4d72573

Please sign in to comment.