diff --git a/ChangeLog b/ChangeLog index 4ca56665cee..031e740e008 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. +* All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead @@ -79,7 +80,7 @@ NEW: Create contract from invoice NEW: Database: Can store the session into database (instead of beeing managed by PHP) NEW: Database: Some core tables are created only at module activation NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks) -NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit. +NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit. NEW: Dictionaries - add possibility to manage countries in EEC NEW: Dictionaries - Availibility dictionnary has a new column unit and number NEW: Display errors in a message box after generating documents @@ -187,9 +188,9 @@ NEW: Can update rank of invoice, proposal and order lines with API update NEW: update rank line is possible on API for customer invoices, sales orders and supplier invoice NEW: Add option MAIN_API_DEBUG to save API logs into a file -Hooks: +Hooks: NEW: Hook getNomUrl available everywhere in tooltip of ref links -NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook +NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook NEW: Add hook before the public ticket list NEW: Add hook for Notif NEW: Add hook for more buttons @@ -221,12 +222,12 @@ NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* There is a new specific permission to be allowed to enter timesheets. If you use timesheet, don't forget to give the new permission (disable and +* There is a new specific permission to be allowed to enter timesheets. If you use timesheet, don't forget to give the new permission (disable and enable the module project if it is not visible). * The default value for MAIN_SECURITY_CSRF_WITH_TOKEN has been set to 2. It means any POST and any GET request that contains the "action" or "massaction" with a value of a sensitive action must also a valid token parameter (With previous value 1, only POST was concerned). Note: With value 3, any URL with parameter "action" or "massaction" need the token, whatever is the value of the action. -* verifCond('stringtoevaluate') now return false when string contains a bad syntax content instead of true. +* verifCond('stringtoevaluate') now return false when string contains a bad syntax content instead of true. * The deprecated method thirdparty_doc_create() has been removed. You can use the generateDocument() instead. * All triggers with a name XXX_UPDATE have been renamed with name XXX_MODIFY for code consistency purpose. * Rename build_path_from_id_categ() into buildPathFromId() and set method to private. @@ -442,7 +443,7 @@ For users: NEW: Online proposal signature NEW: Can define some max limit on expense report (per period, per type or expense, ...) -NEW: Provide a special pages for bookmarks and multicompany for a better use of some mobile applications (like DoliDroid) +NEW: Provide a special pages for bookmarks and multicompany for a better use of some mobile applications (like DoliDroid) NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. NEW: Add option to disable globaly some notifications emails. NEW: #18401 Add __NEWREF__ subtitute to get new object reference. @@ -491,7 +492,7 @@ NEW: can enable/disable external calendar by default NEW: Can hide sender name on PDF documents NEW: Can select lot from a combo list of existing batch numbers (in MRP consumtion) NEW: Can set the default BOM on a product -NEW: Can set/unset the usual working day of the week (friday, saturday, sunday) +NEW: Can set/unset the usual working day of the week (friday, saturday, sunday) NEW: Can show progression of task into combo list of tasks NEW: can upload the odt file for the product doc template NEW: Contract - Add From/to input on search date @@ -555,7 +556,7 @@ For developers: API: NEW: #18319 REST API - Shipment: Add 'close' action / endpoint / POST method. -NEW: add API /approve and /makeOrder for purchase orders +NEW: add API /approve and /makeOrder for purchase orders NEW: API for knowledgemanagement NEW: API get list of legal form of business NEW: API list of staff units @@ -592,21 +593,21 @@ NEW: Experimental feature to manage user sessions in database WARNING: - + Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* ALL EXTERNAL MODULES THAT WERE NOT CORRECTLY DEVELOPPED WILL NOT WORK ON V15 (All modules that forgot to manage the security token field +* ALL EXTERNAL MODULES THAT WERE NOT CORRECTLY DEVELOPPED WILL NOT WORK ON V15 (All modules that forgot to manage the security token field into forms will be broken. The security token field is expected since Dolibarr v9 but a lot of external modules did not implement it). * Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. * Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. -* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). +* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). * The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. * Method getDictvalue has been renamed into getDictionaryValue to match camel case rule. -* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in - method executeCLI() available into core/class/utils.class.php +* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in + method executeCLI() available into core/class/utils.class.php * Class file expeditionbatch.class.php renamed to expeditionlinebatch.class.php * ExpeditionLineBatch::fetchAll is not static anymore and first parameter $db is removed * ExtraFields->showOutputField parameter 4 'extrafieldsobjectkey' is now required -* CommonObject method add_object_linked now sets targettype to 'mymodule_myobject' instead of 'myobject', +* CommonObject method add_object_linked now sets targettype to 'mymodule_myobject' instead of 'myobject', you can use hook 'setLinkedObjectSourceTargetType' to set your usual targettype @@ -895,10 +896,10 @@ For users: ---------- NEW: Module Recruitment to follow application to job positions is now stable. NEW: Feature to make Stock Inventories -NEW: Several security issues after a second private bug hunting campaign. +NEW: Several security issues after a second private bug hunting campaign. NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better) NEW: All main menu entries are using the picto of the module -NEW: Add a copy to clipboard button on some fields +NEW: Add a copy to clipboard button on some fields NEW: Add an example of scheduled job to send email reminder for unpaid invoices NEW: Add some color and picto for the direction of movement NEW: add the column "Channel" into the list of orders @@ -969,7 +970,7 @@ NEW: can show the leave dates/holidays on the agenda view NEW: Support color for types of event Bank -NEW: Bank Entries : display user linked to a salary or a taxes +NEW: Bank Entries : display user linked to a salary or a taxes NEW: Add bulk actions for Bank Transfer ECM/GED @@ -992,7 +993,7 @@ NEW: option to automatically create a login/user when a new subscription of a me NEW: option to select membership type on the online payment page for membership subscription or renewal Products -NEW: Add price min and price min including tax into product export +NEW: Add price min and price min including tax into product export NEW: Add a ref in product customer price NEW: customer ref for product customer prices NEW: Set status of all variants when changing status of parent @@ -1045,8 +1046,8 @@ NEW: add option in Workflow module to set a shipment as closed for Admins -NEW: Add a security center page with all information and advices related to the security of your instance -NEW: Add a performance center page with all information and advices related to the performance of your instance +NEW: Add a security center page with all information and advices related to the security of your instance +NEW: Add a performance center page with all information and advices related to the performance of your instance Modules NEW: Module Recruitment is now stable @@ -1092,7 +1093,7 @@ NEW: API get the list of product ids only NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc NEW: add native compression in REST APIs NEW: Product Variants API, add variant stock to response by parameter -NEW: Product API route added to get product stock and product with or without variants #13739 #17390 +NEW: Product API route added to get product stock and product with or without variants #13739 #17390 Hooks NEW: hook printFieldListTitle for cabyprodserv.php @@ -1117,8 +1118,8 @@ Following changes may create regressions for some external modules, but were nec * Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) * Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. * v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8. -* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in - method executeCLI() available into core/class/utils.class.php +* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in + method executeCLI() available into core/class/utils.class.php ***** ChangeLog for 13.0.5 compared to 13.0.4 ***** @@ -1345,7 +1346,7 @@ NEW: Module "Credit transfer SEPA" to manage payment of vendors using bank credi NEW: Module Intracomm report NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable. NEW: Module Recruitment to manage Job position and applications. -NEW: Several security issues after a private bug bounty campaign. +NEW: Several security issues after a private bug bounty campaign. NEW: Accountancy - add chart of sub accounts NEW: Accountancy - add options to disable binding on sales, purchases & expense reports independently of the modules NEW: Accountancy balance - add a menu entry to show subtotal by group @@ -1481,7 +1482,7 @@ NEW: show user on external calender events (when found) NEW: subject title with company name instead of application title in ticket message NEW: Support for Samba4 AD NEW: TakePOS appearance tab with more visual parameters -NEW: TakePOS add alert before changing thirdparty +NEW: TakePOS add alert before changing thirdparty NEW: TakePOS add third order printer NEW: TakePOS can change thirdparty with barcode scan NEW: TakePOS can create a thirdparty customer from TakePOS frontend @@ -1492,9 +1493,9 @@ NEW: TakePOS display resiliate status for members NEW: TakePOS Gift Receipt NEW: TakePOS multicurrency compatibility NEW: TakePOS multicurrency total -NEW: TakePOS print payment method and change +NEW: TakePOS print payment method and change NEW: TakePOS restrict thirdparty to customer -NEW: TakePOS show available stock +NEW: TakePOS show available stock NEW: TakePOS Weighing Scale compatibility with TakePOS connector #14725 NEW: Thirdparty Import new fields: mother company,outstanding debt limit,bank account,incoterms NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late @@ -1507,8 +1508,8 @@ NEW: VAT report - Invert constant to show by default zero VAT in reports NEW: website page fields selection NEW: website - global header of a website can also have dynamic content NEW: when creating a user from a member linked to a thirdparty, you can choose to create it as external or internal user -NEW: add clone button on miscellaneous payment -NEW: add option to put the product label in bold in the PDF templates if configured #15065 +NEW: add clone button on miscellaneous payment +NEW: add option to put the product label in bold in the PDF templates if configured #15065 NEW: add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF." diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c5a9b311436..76cc9b23f27 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1048,7 +1048,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 46474092448..f9fd5d8ac7e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1412,7 +1412,7 @@ class Propal extends CommonObject } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($this->db); $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $objsoc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4e1b47c598c..9428f76dd8e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -790,7 +790,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result >= 0) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index fd9575dd982..f6b31386215 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/compta/prelevement/class/bonprelevement.class.php - * \ingroup prelevement - * \brief File of withdrawal receipts class + * \file htdocs/compta/prelevement/class/bonprelevement.class.php + * \ingroup prelevement + * \brief File of withdrawal receipts class */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -419,8 +419,8 @@ class BonPrelevement extends CommonObject } else { $paiement = new Paiement($this->db); } - $paiement->datepaye = $date; - $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice + $paiement->datepaye = $date; + $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice if ($this->type == 'bank-transfer') { $paiement->paiementid = 2; @@ -757,14 +757,14 @@ class BonPrelevement extends CommonObject $error = 0; - $datetimeprev = time(); + $datetimeprev = dol_now('gmt'); //Choice the date of the execution direct debit if (!empty($executiondate)) { $datetimeprev = $executiondate; } - $month = strftime("%m", $datetimeprev); - $year = strftime("%Y", $datetimeprev); + $month = dol_print_date($datetimeprev, "%m", 'gmt'); + $year = dol_print_date($datetimeprev, "%Y", 'gmt'); $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); @@ -1743,8 +1743,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date($this->date_echeance, "%d%m", 'gmt')); + fputs($this->file, substr(dol_print_date($this->date_echeance, "%y", 'gmt'), 1)); // Raison Sociale Destinataire C2 @@ -1969,8 +1969,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date($this->date_echeance, "%d%m", 'gmt')); + fputs($this->file, substr(dol_print_date($this->date_echeance, "%y", 'gmt'), 1)); // Raison Sociale C2 diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ffcc8d4e278..93d33565143 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -498,7 +498,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 354f1158b40..1d93ed833ae 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1534,7 +1534,6 @@ abstract class CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return array with list of possible values for type of contacts * @@ -1548,7 +1547,6 @@ abstract class CommonObject */ public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '', $excludeelement = '') { - // phpcs:enable global $langs, $conf; $langs->loadLangs(array('bills', 'contracts', 'interventions', 'orders', 'projects', 'propal', 'ticket', 'agenda')); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 04ab1a40e51..3899af425bc 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1567,7 +1567,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $productCustomerPriceStatic = new Productcustomerprice($db); $filter = array('fk_product' => $idprod, 'fk_soc' => $object->socid); - $nbCustomerPrices = $productCustomerPriceStatic->fetch_all('', '', 1, 0, $filter); + $nbCustomerPrices = $productCustomerPriceStatic->fetchAll('', '', 1, 0, $filter); if ($nbCustomerPrices > 0) { $productCustomerPrice = $productCustomerPriceStatic->lines[0]; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 9aae70d0d6d..db48c0e7fce 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -590,7 +590,7 @@ class Cronjob extends CommonObject $sql .= " WHERE ".implode(' AND ', $sqlwhere); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index b2ce6e48c09..24da89b7619 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -188,7 +188,7 @@ if ($action == 'fetch' && !empty($id)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $socid); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $found = true; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f455806e0ce..25cbf623c8d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1039,7 +1039,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $soc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines [0]->price); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1c17deae602..91a55b4ca30 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -670,7 +670,7 @@ class Products extends DolibarrApi if ($thirdparty_id) { $filter['t.fk_soc'] .= $thirdparty_id; } - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); } if (empty($prodcustprice->lines)) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3ef5b5832d4..1a8396fd331 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1872,7 +1872,7 @@ class Product extends CommonObject $filter = array('t.fk_product' => $this->id, 't.fk_soc' => $thirdparty_buyer->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index ed003d85667..197816f48ca 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -354,11 +354,31 @@ class Productcustomerprice extends CommonObject * @param int $limit page * @param int $offset offset * @param array $filter Filter for select + * @deprecated since dolibarr v17 use fetchAll * @return int <0 if KO, >0 if OK */ public function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { // phpcs:enable + + dol_syslog(get_class($this)."::fetch_all is deprecated, use fetchAll instead", LOG_NOTICE); + + return $this->fetchAll($sortorder, $sortfield, $limit, $offset, $filter); + } + + /** + * Load all customer prices in memory from database + * + * @param string $sortorder order + * @param string $sortfield field + * @param int $limit page + * @param int $offset offset + * @param array $filter Filter for select + * @return int <0 if KO, >0 if OK + * @since dolibarr v17 + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) + { global $langs; if (empty($sortfield)) { @@ -421,7 +441,7 @@ class Productcustomerprice extends CommonObject $sql .= $this->db->plimit($limit + 1, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->lines = array(); @@ -832,7 +852,7 @@ class Productcustomerprice extends CommonObject 't.fk_product' => $this->fk_product, 't.fk_soc' => $obj->rowid ); - $result = $prodsocprice->fetch_all('', '', 0, 0, $filter); + $result = $prodsocprice->fetchAll('', '', 0, 0, $filter); if ($result < 0) { $error++; $this->error = $prodsocprice->error; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index aa9a34336b0..1dda1f4c89a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2222,10 +2222,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll($sortorder, $sortfield, 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index d88355c6912..69893559dfa 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -243,7 +243,7 @@ $num = 0; $title = $langs->trans('StockAtDate'); -$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; +$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price, p.pmp,'; $sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,'; $sql .= ' p.tms as datem, p.duration, p.tobuy, p.stock, '; if ($fk_warehouse > 0) { @@ -565,12 +565,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // PMP value print ''; - if (price2num($objp->estimatedvalue, 'MT')) { - print ''.price(price2num($objp->estimatedvalue, 'MT'), 1).''; + if (price2num($stock * $objp->pmp, 'MT')) { + print ''.price(price2num($stock * $objp->pmp, 'MT'), 1).''; } else { print ''; } - $totalbuyingprice += $objp->estimatedvalue; + $totalbuyingprice += $stock * $objp->pmp; print ''; // Selling value diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 46371fead0f..3e1a2615cd9 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -527,7 +527,7 @@ class Dolresource extends CommonObject if ($limit) { $sql .= $this->db->plimit($limit, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $this->lines = array(); $resql = $this->db->query($sql); diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 23282fe6363..6b649b396db 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -169,7 +169,7 @@ if ($search_type != '') { } // Including the previous script generate the correct SQL filter for all the extrafields -// we are playing with the behaviour of the Dolresource::fetch_all() by generating a fake +// we are playing with the behaviour of the Dolresource::fetchAll() by generating a fake // extrafields filter key to make it works $filter['ef.resource'] = $sql; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 5ff503c9eec..a75a194a0e8 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -532,10 +532,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll('', '', 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); }