Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2017-02-02 02:25:49 +01:00
commit 13f37b2cb9
13 changed files with 23 additions and 13 deletions

View File

@ -150,6 +150,7 @@ Dolibarr better:
- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters,
no more required, were also removed. Use this new one if you were using one of them.
- The trigger that activate or close a contract line is run on a contract line, not on contract.
- Method commande->set_availability(user, availability_id) removed from commande class, use method commande->availability(availability_id, notrigger).
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.

View File

@ -86,14 +86,14 @@ $idpays = $p[0];
$sql = "SELECT er.rowid, er.ref, er.date_debut as de,";
$sql .= " erd.rowid as erdid, erd.comments, erd.total_ttc, erd.tva_tx, erd.total_ht, erd.total_tva, erd.fk_code_ventilation,";
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_code,";
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_account,";
$sql .= " f.accountancy_code, ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON erd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
$sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_valid";
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_author";
$sql .= " WHERE er.fk_statut > 0 ";
$sql .= " AND erd.fk_code_ventilation > 0 ";
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy

View File

@ -242,7 +242,8 @@ class Commande extends CommonOrder
}
else
{
dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
$this->error=$obj->error;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 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
@ -773,7 +774,7 @@ if ($resql)
if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'balance','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))

View File

@ -3205,7 +3205,8 @@ class Facture extends CommonInvoice
* set up mask.
*/
if ($mode != 'last' && !$numref) {
dol_print_error($this->db,"Facture::getNextNumRef ".$obj->error);
$this->error=$obj->error;
//dol_print_error($this->db,"Facture::getNextNumRef ".$obj->error);
return "";
}

View File

@ -1312,7 +1312,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
if ($detail->sellby) $dte[]=$outputlangs->transnoentitiesnoconv('printSellby',dol_print_date($detail->sellby, $format, false, $outputlangs));
if ($detail->batch) $dte[]=$outputlangs->transnoentitiesnoconv('printBatch',$detail->batch);
$dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->dluo_qty);
$libelleproduitservice.= "__N__ ".implode($dte,"-");
$libelleproduitservice.= "__N__ ".implode(" - ", $dte);
}
}

View File

@ -60,7 +60,7 @@ class ExpenseReport extends CommonObject
// Create
var $date_create;
var $fk_user_author;
var $fk_user_author; // the user the expense report is for (not really the author)
// Update
var $date_modif;

View File

@ -524,13 +524,14 @@ class PaymentExpenseReport extends CommonObject
{
if ($mode == 'payment_expensereport')
{
$euser = new User($this->db);
$euser->fetch($key);
$er = new ExpenseReport($this->db);
$er->fetch($key);
$er->fetch_user($er->fk_user_author);
$result=$acc->add_url_line(
$bank_line_id,
$euser->id,
$er->user->id,
DOL_URL_ROOT.'/user/card.php?id=',
$euser->getFullName($langs),
$er->user->getFullName($langs),
'user'
);
if ($result <= 0)

View File

@ -1929,6 +1929,7 @@ class FactureFournisseur extends CommonInvoice
}
else
{
$this->error=$obj->error;
//dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return false;
}

View File

@ -77,6 +77,7 @@ $search_total_vat=GETPOST('search_total_vat','alpha');
$search_total_ttc=GETPOST('search_total_ttc','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$search_project_ref=GETPOST('search_project_ref','alpha');
$page = GETPOST('page','int');
$sortorder = GETPOST('sortorder','alpha');
@ -204,6 +205,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$deliverymonth='';
$deliveryyear='';
$billed='';
$search_project_ref='';
$search_array_options=array();
}
@ -350,6 +352,7 @@ if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.elemen
if ($search_total_ht != '') $sql.= natural_search('cf.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql.= natural_search('cf.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql.= natural_search('cf.total_ttc', $search_total_ttc, 1);
if ($search_project_ref != '') $sql.= natural_search("p.ref",$search_project_ref);
// Add where from extra fields
foreach ($search_array_options as $key => $val)

View File

@ -35,7 +35,7 @@ CREATE TABLE llx_expensereport (
date_refuse datetime,
date_cancel datetime,
tms timestamp,
fk_user_author integer NOT NULL,
fk_user_author integer NOT NULL, -- not the user author but the user the expense report is for
fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
fk_user_validator integer DEFAULT NULL,

View File

@ -60,7 +60,7 @@ SellingPrice=Selling price
SellingPriceHT=Selling price (net of tax)
SellingPriceTTC=Selling price (inc. tax)
CostPriceDescription=This price (net of tax) can be used to store the average amount this product cost to your company. It may be any price you calculate yourself, for example from the average buying price plus average production and distribution cost.
CostPriceUsage=In a future version, this value could be used for margin calculation.
CostPriceUsage=This value could be used for margin calculation.
SoldAmount=Sold amount
PurchasedAmount=Purchased amount
NewPrice=New price

View File

@ -700,6 +700,7 @@ if ($id > 0 || $ref)
if ($user->rights->produit->creer || $user->rights->service->creer)
{
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$productfourn->fourn_id.'&amp;action=add_price&amp;rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";
print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$productfourn->fourn_id.'&amp;action=ask_remove_pf&amp;rowid='.$productfourn->product_fourn_price_id.'">'.img_picto($langs->trans("Remove"),'disable.png').'</a>';
}