diff --git a/ChangeLog b/ChangeLog
index 516bc270321..d44e811c15c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,153 +4,155 @@ English Dolibarr ChangeLog
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
+
For users:
+----------
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
NEW: Several security issues after a private bug bounty campaign.
NEW: #15065 Put the product label in bold in the PDF templates if configured
-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
-NEW: Accountancy - Move to real ledger, real journals, menu disposition
-NEW: Accountancy - On transfers, select the periodicity by default
-NEW: New currency rate editor.
-NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr
-NEW: Add a counter of number of words for pages in website module
-NEW: add alert before changing thirdparty in takepos
-NEW: Add a page to list Stock at a given date in the past.
-NEW: Add a start date to begin binding in accountancy
-NEW: Add a statistics page to list popularity of products on invoices
-NEW: Add calendar selection for agenda view
-NEW: Support documents generation for ticket edition (pdf or odt)
-NEW: Add column payment term into list of supplier invoices.
-NEW: Add column quantity in product margin page
-NEW: Add column vat rate in page to define accounting account on product/service
-NEW: Add common list function for available app/module page
+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
+NEW: Accountancy - move to real ledger, real journals, menu disposition
+NEW: Accountancy - on transfers, select the periodicity by default
+NEW: new currency rate editor
+NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
+NEW: add a counter of number of words for pages in website module
+NEW: add alert before changing thirdparty in TakePOS
+NEW: add a page to list Stock at a given date in the past
+NEW: add a start date to begin binding in accountancy
+NEW: add a statistics page to list popularity of products on invoices
+NEW: add calendar selection for agenda view
+NEW: Support documents generation for ticket edition (PDF or ODT)
+NEW: add column payment term into list of supplier invoices
+NEW: add column quantity in product margin page
+NEW: add column vat rate in page to define accounting account on product/service
+NEW: add common list function for available app/module page
NEW: add costprice in fields of products list
-NEW: Added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
-NEW: Added incoterms dara into the substitution array
-NEW: Add employee link in expense report binding page
-NEW: Add export for various payment
-NEW: add extra fields labels and values in mail on create ticket
-NEW: Add extrafields support on ECM module
-NEW: Add filter rules "is answer" and "is not answer" in email collector
-NEW: Add focus when editing on product/stock/product.php Close #14548
+NEW: added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
+NEW: added incoterms data into the substitution array
+NEW: add employee link in expense report binding page
+NEW: add export for various payment
+NEW: add Extrafields labels and values in mail on create ticket
+NEW: add Extrafields support on ECM module
+NEW: add filter rules "is answer" and "is not answer" in email collector
+NEW: add focus when editing on product/stock/product.php Close #14548
NEW: add formConfirm hook on product page
NEW: add free text on each terminal of cash desk
-NEW: Add function dolButtonToOpenUrlInDialogPopup() to be able to open
-NEW: Add global search for customer payments and vendor payments
-NEW: Add global search for miscellaneous payments
-NEW: Add helper function for table headers with numbers
+NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open
+NEW: add global search for customer payments and vendor payments
+NEW: add global search for miscellaneous payments
+NEW: add helper function for table headers with numbers
NEW: add hooks on stats pages
-NEW: Add link to edit property from search result of website pages
-NEW: Add link to reset qty on supplier dispatch page
+NEW: add link to edit property from search result of website pages
+NEW: add link to reset qty on supplier dispatch page
NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header stored by email collector
-NEW: Add Manufacturing Orders attached files into the automatic ECM view
+NEW: add Manufacturing Orders attached files into the automatic ECM view
NEW: add margin info in invoice list
-NEW: Add mass action to set category on a list of website pages.
-NEW: Add mass deletion for events
-NEW: Add mass deletion for draft invoices
-NEW: Add __MEMBER_TYPE__ substitution key
-NEW: Add a message in error_log after detection of SQL or script injection
-NEW: Add module Credit transfer SEPA to manage payment of supplier using
-NEW: Add more filters on monthly statement list
-NEW: Add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
-NEW: Add option to define a default warehouse at user level
-NEW: Add option to include products without alert in replenish
+NEW: add mass action to set category on a list of website pages
+NEW: add mass deletion for events
+NEW: add mass deletion for draft invoices
+NEW: add __MEMBER_TYPE__ substitution key
+NEW: add a message in error_log after detection of SQL or script injection
+NEW: add module Credit transfer SEPA to manage payment of supplier using
+NEW: add more filters on monthly statement list
+NEW: add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
+NEW: add option to define a default warehouse at user level
+NEW: add option to include products without alert in replenish
NEW: add order by lastname and firstname by default in get sales representatives
-NEW: Add param to not show links when output tags
-NEW: Add PDF document templates for warehouses (list of stock)
-NEW: Add property cssview when declaring fields of an object
-NEW: Add prospect status managment for the contact with managment of custom icon
-NEW: Add public note on products. This also partially fix the #14342
-NEW: Add quick dropdown menu in top right menu (MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
+NEW: add param to not show links when output tags
+NEW: add PDF document templates for warehouses (list of stock)
+NEW: add property cssview when declaring fields of an object
+NEW: add prospect status managment for the contact with managment of custom icon
+NEW: add public note on products ; this also partially fix the #14342
+NEW: add quick dropdown menu in top right menu (MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
NEW: add region in export companies and contacts
NEW: add rights on margin info on invoice list
-NEW: Add search param for close date on order list
+NEW: add search param for close date on order list
NEW: add send context for ticket
-NEW: Add show preview for mail attachement on form mail
+NEW: add show preview for mail attachement on form mail
NEW: add state origin for product
NEW: add State/Province origin for products
-NEW: Add the workflow interaction close intervention on closing ticket
-NEW: Add third order printer to TakePOS
+NEW: add the workflow interaction close intervention on closing ticket
+NEW: add third order printer to TakePOS
NEW: add tracking number in list and search_all items
NEW: add two hooks printFieldListFrom and printFieldSearchParam
-NEW: Add __TYPE__ substitution key
-NEW: Add validation of MX domain for emails
+NEW: add __TYPE__ substitution key
+NEW: add validation of MX domain for emails
NEW: add vcard for aderent and user
NEW: add week number for month view in agenda
NEW: Algeria data (tva and forme_juridique)
-NEW: Allow click on all header numbers on commerce area
-NEW: Allow to reopen interventions (green button)
-NEW: Allow zero quality on supplier/vendor order line
-NEW: Appearance tab in TakePOS with more visual parameters
-NEW: Better currency rate editor
-NEW: Calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
-NEW: Can add event to log into blockedlog module with a constant.
-NEW: Can build vendor invoice from vendor orders
-NEW: Can change a product in line of recurring invoice or contract
-NEW: Can change size of logo on PDF documents
-NEW: Can change VAT rate of all lines of a draft object in one step.
-NEW: Can define date range of validity of a login during creation
-NEW: Can disable, from edit page, the whole web site
+NEW: allow click on all header numbers on commerce area
+NEW: allow to reopen interventions (green button)
+NEW: allow zero quality on supplier/vendor order line
+NEW: appearance tab in TakePOS with more visual parameters
+NEW: better currency rate editor
+NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
+NEW: can add event to log into blockedlog module with a constant
+NEW: can build vendor invoice from vendor orders
+NEW: can change a product in line of recurring invoice or contract
+NEW: can change size of logo on PDF documents
+NEW: can change VAT rate of all lines of a draft object in one step
+NEW: can define date range of validity of a login during creation
+NEW: can disable, from edit page, the whole web site
NEW: can edit and set sales representatives directly on thirdparty card
NEW: Can edit the list of sending email profiles.
-NEW: Can enable/disable users in bulk actions
-NEW: Can filter on accounting system ref in export of chart of account
-NEW: Can filter on container type, language and tags in the list of pages
-NEW: Can force the antivirus from conf file or autoprepend ini setup.
-NEW: Can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
-NEW: Can import proposals, sales orders, supplier invoices
+NEW: can enable/disable users in bulk actions
+NEW: can filter on accounting system ref in export of chart of account
+NEW: can filter on container type, language and tags in the list of pages
+NEW: can force the antivirus from conf file or autoprepend ini setup
+NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
+NEW: can import proposals, sales orders, supplier invoices
NEW: can set a dedicated SMTP config for sending email from public ticket interface
-NEW: Can set tags/categories to website pages.
-NEW: Can set type of price without tax per default for new sale price creation
-NEW: Can use desired stock of a given warehouse for replenishment
-NEW: Can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
-NEW: change thirdparty with barcode scan in takepos
-NEW: Common behavior for monthly leave list view
+NEW: can set tags/categories to website pages
+NEW: can set type of price without tax per default for new sale price creation
+NEW: can use desired stock of a given warehouse for replenishment
+NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
+NEW: change thirdparty with barcode scan in TakePOS
+NEW: common behavior for monthly leave list view
NEW: conf to allow show full arbo in warehouse getnomurl
NEW: convert all subscription in datetime
-NEW: create thirdparty customer from TAKEPOS
-NEW: Date shipment from order accepts hours
-NEW: Declinaison price level compatibility
-NEW: Delayed payment in TakePOS
-NEW: Development of module Recruitment
-NEW: display date range if exist in takepos
-NEW: display resiliate status in takepos for member
+NEW: create thirdparty customer from TakePOS
+NEW: date shipment from order accepts hours
+NEW: declinaison price level compatibility
+NEW: delayed payment in TakePOS
+NEW: development of module Recruitment
+NEW: display date range if exist in TakePOS
+NEW: display resiliate status in TakePOS for member
NEW: display stat for BOM on "object referent"/linked Object product tab
NEW: edit and update a ticket
NEW: edit or delete dispatched lines
-NEW: Email configuration - Allow auto signed certificat when smtp ssl activated
+NEW: Email configuration - allow auto signed certificat when smtp ssl activated
NEW: enable free emails input with select2
NEW: endpoint getContacts and Clean results
NEW: Events in agenda for contact
NEW: Field to link website page to an other object
-NEW: Fill ECM src object fields in dol_add_file_process
+NEW: fill ECM src object fields in dol_add_file_process
NEW: filter on progress column in task list
NEW: filter product list by country and/or state/province
NEW: format tickets sent by mail in public interface
NEW: add juridical status for Algeria
NEW: form to add customer/supplier into categories
-NEW: Framework is ready for CSRF token protection on explicit GET URLs.
+NEW: Framework is ready for CSRF token protection on explicit GET URLs
NEW: get all child recursively
-NEW: Get contacts list of a given order
+NEW: get contacts list of a given order
NEW: helper functions for export with phpspreadsheet
NEW: hide closed contract lines
-NEW: hide label in pdf for variants
+NEW: hide label in PDF for variants
NEW: Hook on propal card
-NEW: If specific help page is available, we change color of icon
-NEW: Include the tag editor of page as a popup into website editor
-NEW: Introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
-NEW: Introducing new modal boxes in TakePOS
-NEW: Keep takepos terminal when login/logout
-NEW: Link on balance to the ledger
+NEW: if specific help page is available, we change color of icon
+NEW: include the tag editor of page as a popup into website editor
+NEW: introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
+NEW: introducing new modal boxes in TakePOS
+NEW: keep TakePOS terminal when login/logout
+NEW: link on balance to the ledger
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
NEW: manage errors on update extra fields in ticket card
NEW: mass-actions for the event list view
NEW: Module Intracomm report
-NEW: More filter for "View change logs"
-NEW: multicurrency total in takepos
+NEW: more filter for "View change logs"
+NEW: multicurrency total in TakePOS
NEW: multiselect type and date to date filter
NEW: Nature of product is now a dictionay
NEW: new line template: hidden conf to fill service dates from the last service line
@@ -159,38 +161,38 @@ NEW: possibilty to group payments by mode and show their subtotal
NEW: Print payment method and change in TakePOS
NEW: Priority and transparency from external calendar events
NEW: Products Import/Export 'default warehouse' and 'use batch number' fields
-NEW: Purchase price table: Added filterable table columns
+NEW: Purchase price table: added filterable table columns
NEW: rate editor for multicurrency
NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines
NEW: remove new lines in mail on add ticket message
-NEW: restrict thirdparty to customer in takepos
-NEW: Allow to edit "demand reason" field though API
+NEW: restrict thirdparty to customer in TakePOS
+NEW: allow to edit "demand reason" field though API
NEW: Rule "email to" accept wildcard *
NEW: Save filter of the project homepage
-NEW: Select-able columns on customer invoice paymnet list
-NEW: Select-able columns on miscellaneous payments + more data columns
-NEW: Select-able columns on social taxes list
-NEW: Select-able columns on supplier invoice payment list
+NEW: select-able columns on customer invoice paymnet list
+NEW: select-able columns on miscellaneous payments + more data columns
+NEW: select-able columns on social taxes list
+NEW: select-able columns on supplier invoice payment list
NEW: send context and remove new lines on create ticket
NEW: set entity when creating invoice on takepos
-NEW: Show available stock in TakePOS
-NEW: Show category filter on lists only when user have rights to read categories
-NEW: Show header number and make it clickable in warehouse arean, payment area, shipment area
-NEW: Show image of user in the combo select of users
-NEW: Show label on batch card
-NEW: Show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
+NEW: show available stock in TakePOS
+NEW: show category filter on lists only when user have rights to read categories
+NEW: show header number and make it clickable in warehouse arean, payment area, shipment area
+NEW: show image of user in the combo select of users
+NEW: show label on batch card
+NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: show links for select and multi-select in category extra field
-NEW: Show module and permission ids on user/group rights (only admin)
-NEW: Show place from events on import calender
-NEW: Show references in contract form on interventions
-NEW: Show tags and status in search list of website pages
-NEW: Show user on external calender events (when found)
+NEW: show module and permission ids on user/group rights (only admin)
+NEW: show place from events on import calender
+NEW: show references in contract form on interventions
+NEW: show tags and status in search list of website pages
+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 connector compatibility with RECEIPT PRINTERS module
NEW: TakePOS Gift Receipt
NEW: TakePOS Multicurrency compatibility
-NEW: The global header of a website can also have dynamic content
+NEW: the global header of a website can also have dynamic content
NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
NEW: ticket classification on create from email collector
@@ -199,16 +201,18 @@ NEW: translate classification labels in ticket
NEW: triggers create, modify, delete
NEW: VAT for Algeria
NEW: Use preselect third-party from list on new card
-NEW: Vat report - Invert constant to show by default zero vat in reports
+NEW: VAT report - Invert constant to show by default zero vat in reports
NEW: website page fields selection
NEW: Weighing Scale compatibility with TakePOS connector
-NEW: When creating a user from a member linked to a thirdparty, you can choose to create if as external or internal user
-NEW: Add clone functionality on miscellaneous payment
+NEW: when creating a user from a member linked to a thirdparty, you can choose to create if as external or internal user
+NEW: add clone functionality on miscellaneous payment
+
For developers:
+---------------
NEW: Can use dynamic code into the 'enabled' property of DAO fields
-NEW: API Can update a payment
-NEW: api get member by thirdparty
+NEW: API can update a payment
+NEW: API get member by thirdparty
NEW: API get thirdparty by barcode
NEW: API get users by email / login
NEW: fetch contact by email with REST API
@@ -216,14 +220,15 @@ NEW: field ref_ext in llx_commandedet
NEW: fields ref_ext for Attributes and Combinations
NEW: get state by REST API
NEW: get state dictionnary by REST API
-NEW: Improve Product API for variant products
-NEW: Oauth SCOPE for Admin SDK
-NEW: Retrieve discount from invoice from API
+NEW: improve Product API for variant products
+NEW: OAuth SCOPE for Admin SDK
+NEW: retrieve discount from invoice from API
NEW: standardizes API thirdparties by email like other object
-NEW: thirdparty REST API: endpoint to set price level
-NEW: Use new category API for project list view
+NEW: Thirdparty REST API: endpoint to set price level
+NEW: use new category API for project list view
NEW: Triggers Attributes and Attributes values
-NEW: Add hooks on newpayment page to allow external payment modules
+NEW: add hooks on newpayment page to allow external payment modules
+
WARNING:
@@ -289,6 +294,7 @@ FIX: Visualization rights correction on last modified contacts box
FIX: Wrong redirection
FIX: Yogosha report 4425 (backport)
+
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
FIX: computation of the bottom margin of
returns NaN because body is not loaded yet
FIX: DebugBar hides content at page bottom
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index f9c14b91ac3..969bf3a8906 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -37,7 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->loadLangs(array("companies", "members", "other"));
-$id = GETPOST('id', 'int');
+$id = GETPOSTISSET('id') ? GETPOST('id', 'int') : GETPOST('rowid', 'int');
+$ref = GETPOST('ref', 'alphanohtml');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
@@ -60,7 +61,7 @@ if (!$sortfield) $sortfield = "name";
$form = new Form($db);
$object = new Adherent($db);
$membert = new AdherentType($db);
-$result = $object->fetch($id);
+$result = $object->fetch($id, $ref);
if ($result < 0) {
dol_print_error($db);
exit;
diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php
index 92423977be8..cf752878605 100644
--- a/htdocs/bom/bom_document.php
+++ b/htdocs/bom/bom_document.php
@@ -69,8 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
-//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity?$object->entity:1] . "/bom/" . dol_sanitizeFileName($object->id);
-if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".dol_sanitizeFileName($object->ref);
+if ($id > 0 || !empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object);
/*
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index b8d0949a1f0..5f7687a3d26 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -153,7 +153,7 @@ if ($action == 'create')
print '
';
- if ($action == 'edit') print 'position).'">';
+ if ($action == 'edit') print 'position).'">';
else print $object->position;
print '
';
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index 7f70d74f5d9..6ad2770aa25 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2005-2020 Laurent Destailleur
*
* 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
@@ -197,14 +197,14 @@ while ($i < min($num, $limit))
// Title
print "
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index 61971945183..5c1680d9ecb 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -205,7 +205,8 @@ $typewecanchangeinto = array(
'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'url'=>array('varchar', 'phone', 'mail', 'url', 'select'),
'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'),
- 'select'=>array('varchar', 'phone', 'mail', 'url', 'select')
+ 'select'=>array('varchar', 'phone', 'mail', 'url', 'select'),
+ 'date'=>array('date', 'datetime')
);
/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert
if ($size <= 255 && in_array($type, array('text', 'html'))) {
@@ -224,6 +225,7 @@ if (in_array($type, array_keys($typewecanchangeinto)))
else print '';
}
print '';
+ print ajax_combobox('type');
} else {
print $type2label[$type];
print '';
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index d177ce7637c..401e1079d35 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -693,7 +693,8 @@ if (!empty($usemargins) && $user->rights->margins->creer)
$("#buying_price").val("").show();
/* Call post to load content of combo list fournprice_predef */
- $.post('/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val(), 'token': '' }, function(data) {
+ var token = ''; // For AJAX Call we use old 'token' and not 'newtoken'
+ $.post('/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val(), 'token': token }, function(data) {
if (data && data.length > 0)
{
var options = ''; var defaultkey = ''; var defaultprice = ''; var bestpricefound = 0;
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 6b3639d65eb..b7f0b8d5da1 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -434,7 +434,8 @@ jQuery(document).ready(function()
});
/* Init field buying_price and fournprice */
- $.post('/fourn/ajax/getSupplierPrices.php', {'idprod': fk_product ? $line->fk_product : 0; ?>, 'token': ''}, function(data) {
+ var token = ''; // For AJAX Call we use old 'token' and not 'newtoken'
+ $.post('/fourn/ajax/getSupplierPrices.php', {'idprod': fk_product ? $line->fk_product : 0; ?>, 'token': token }, function(data) {
if (data && data.length > 0) {
var options = '';
var trouve=false;
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 77e25704a6b..2cef2c39320 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -105,6 +105,8 @@ $hookmanager->initHooks(array('expeditioncard', 'globalcard'));
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch);
+$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
+
/*
* Actions
@@ -201,8 +203,6 @@ if (empty($reshook))
$object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int');
- $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
-
// We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver
$classname = ucfirst($object->origin);
$objectsrc = new $classname($db);
@@ -936,8 +936,7 @@ if ($action == 'create')
// Date delivery planned
print '
'.$langs->trans("DateDeliveryPlanned").'
';
print '
';
- //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed.
- $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
+ $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "
';
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 59d34f728b1..292690020b9 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -3807,11 +3807,11 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Verifie si c'est un sous-produit
+ * Check if it is a sub-product into a kit
*
- * @param int $fk_parent Id du produit auquel le produit est lie
- * @param int $fk_child Id du produit lie
- * @return int < 0 si erreur, > 0 si ok
+ * @param int $fk_parent Id of parent kit product
+ * @param int $fk_child Id of child product
+ * @return int <0 if KO, >0 if OK
*/
public function is_sousproduit($fk_parent, $fk_child)
{
@@ -3827,6 +3827,7 @@ class Product extends CommonObject
if ($num > 0) {
$obj = $this->db->fetch_object($result);
+
$this->is_sousproduit_qty = $obj->qty;
$this->is_sousproduit_incdec = $obj->incdec;
@@ -4221,17 +4222,26 @@ class Product extends CommonObject
}
/**
- * Return all parent products for current product (first level only)
+ * Count all parent and children products for current product (first level only)
*
- * @return int Nb of father + child
+ * @param int $mode 0=Both parent and child, -1=Parents only, 1=Children only
+ * @return int Nb of father + child
+ * @see getFather(), get_sousproduits_arbo()
*/
- public function hasFatherOrChild()
+ public function hasFatherOrChild($mode = 0)
{
$nb = 0;
$sql = "SELECT COUNT(pa.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."product_association as pa";
- $sql .= " WHERE pa.fk_product_fils = ".$this->id." OR pa.fk_product_pere = ".$this->id;
+ if ($mode == 0) {
+ $sql .= " WHERE pa.fk_product_fils = ".$this->id." OR pa.fk_product_pere = ".$this->id;
+ } elseif ($mode == -1) {
+ $sql .= " WHERE pa.fk_product_fils = ".$this->id; // We are a child, so we found lines that link to parents (can have several parents)
+ } elseif ($mode == 1) {
+ $sql .= " WHERE pa.fk_product_pere = ".$this->id; // We are a parent, so we found lines that link to children (can have several children)
+ }
+
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
@@ -4297,6 +4307,7 @@ class Product extends CommonObject
* Return all parent products for current product (first level only)
*
* @return array Array of product
+ * @see hasFatherOrChild()
*/
public function getFather()
{
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index 4bedbd3d2ba..f89305b4d95 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -170,6 +170,7 @@ if ($id > 0 || !empty($ref))
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '
';
+
if (!empty($conf->expedition->enabled)) {
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal)
print '