diff --git a/ChangeLog b/ChangeLog index 9b561820629..d8387c6a0e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index ce1c632e85b..8bc62c27ef6 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -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 diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 50bb9e6a009..7bad08b2f84 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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 ""; } } diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 54c77ed6e73..ad3817f28cd 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Juanjo Menent * * 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)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 73a4a5a85ab..305b8a7e1c0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -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 ""; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 107111a8986..60e8db91b0f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -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); } } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 2c01e5f9506..484499ac016 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -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; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 7cda584abbf..9fc8c7627dd 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -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) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 29b52fe45c1..6c0d493373c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -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; } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 90647b7c65a..49de2dac7a3 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -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) diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql index a6b45daddf4..ac1ec890788 100755 --- a/htdocs/install/mysql/tables/llx_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.sql @@ -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, diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 0abf09b3442..7b4d7ae9e94 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -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 diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index a71db876dd0..27b3780e2a7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -700,6 +700,7 @@ if ($id > 0 || $ref) if ($user->rights->produit->creer || $user->rights->service->creer) { print ''.img_edit().""; + print '   '; print ''.img_picto($langs->trans("Remove"),'disable.png').''; }