';
}
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 95a87195fd0..ff253f9794e 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -86,6 +86,11 @@ class Fichinter extends CommonObject
*/
public $element = 'fichinter';
+ /**
+ * @var string Name of field in database that is used as reference when object is linked to another one.
+ */
+ public $fk_element = 'fk_fichinter';
+
/**
* @var string Name of table without prefix where object is stored
*/
diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
index af12e015779..effda15ab02 100644
--- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
+++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
@@ -491,7 +491,7 @@ ALTER TABLE llx_partnership ADD COLUMN email_partnership varchar(64) after fk_me
ALTER TABLE llx_contratdet ADD INDEX idx_contratdet_statut (statut);
-ALTER TABLE fk_product_price_product DROP FOREIGN KEY fk_product_price_product;
+ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_product;
ALTER TABLE llx_societe_rib ADD COLUMN ext_payment_site varchar(128);
@@ -681,7 +681,7 @@ ALTER TABLE llx_product_lot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT
ALTER TABLE llx_product_lot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price_by_qty CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-ALTER TABLE llx_product_stock_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+ALTER TABLE llx_product_warehouse_properties CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_stock CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_projet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_projet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
@@ -723,3 +723,6 @@ ALTER TABLE llx_user CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP O
ALTER TABLE llx_salary_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- 15.0 -> 16.0 rename llx_advtargetemailing to llx_mailing_advtarget
ALTER TABLE llx_mailing_advtarget CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+
+-- 3.6 -> 3.7 typo on llx_adherents ('end with s') and varchar is 128
+ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql
index 36259f40cfc..a6918580a4f 100644
--- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql
+++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql
@@ -234,3 +234,5 @@ UPDATE llx_menu SET url = CONCAT(url, '&mode=init') WHERE fk_mainmenu = 'ticket'
-- VMYSQL4.1 ALTER TABLE llx_asset_depreciation_options_economic MODIFY COLUMN accelerated_depreciation_option boolean DEFAULT false;
-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN llx_asset_depreciation_options_economic DROP DEFAULT, ALTER COLUMN llx_asset_depreciation_options_economic TYPE boolean USING llx_asset_depreciation_options_economic::integer <> 0, ALTER COLUMN llx_asset_depreciation_options_economic SET DEFAULT false;
+
+ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql
index 016dcf758ac..5d80d3405b3 100644
--- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql
+++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql
@@ -451,4 +451,6 @@ CREATE TABLE llx_workstation_workstation_extrafields
ALTER TABLE llx_workstation_workstation_extrafields ADD INDEX idx_workstation_workstation_extrafields (fk_object);
+ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
+
-- end of migration
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index d619c8904d1..92ffd7ed602 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -21,6 +21,7 @@ NoSubCat=No subcategory.
SubCatOf=Subcategory
FoundCats=Found tags/categories
ImpossibleAddCat=Impossible to add the tag/category %s
+ErrorCategoryCannotBeItsOwnParent=A tag/category cannot be its own parent.
WasAddedSuccessfully=%s was added successfully.
ObjectAlreadyLinkedToCategory=Element is already linked to this tag/category.
ProductIsInCategories=Product/service is linked to following tags/categories
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 3a464b934c5..5c18f038180 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -1867,7 +1867,7 @@ class Mo extends CommonObject
$this->tpl['label'] = '';
if (!empty($line->fk_product) && $line->fk_product > 0) {
$productstatic->fetch($line->fk_product);
- $productstatic->load_virtual_stock();
+ $productstatic->load_stock(); // load_virtual_stock() is done in load_stock()
$this->tpl['label'] .= $productstatic->getNomUrl(1);
//$this->tpl['label'].= ' - '.$productstatic->label;
} else {
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 848ef30c61a..769aea587c2 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -626,7 +626,7 @@ class FormProduct
if ($mode == 1) {
$return .= $lines->short_label;
} elseif ($mode == 2) {
- $return .= $lines->scale;
+ $return .= (int) $lines->scale;
} else {
$return .= $lines->id;
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 1bb0a45ce0b..e76760791ad 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -1453,6 +1453,8 @@ class SupplierProposal extends CommonObject
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$line->fk_unit = $objp->fk_unit;
+ $line->fetch_optionals();
+
$this->lines[$i] = $line;
$i++;
@@ -2721,6 +2723,8 @@ class SupplierProposal extends CommonObject
$this->lines[$i]->fk_unit = $obj->fk_unit;
$this->lines[$i]->extraparams = !empty($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array();
+ $this->lines[$i]->fetch_optionals();
+
$i++;
}
$this->db->free($resql);
diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php
index 7369a45ad49..89ea838c80f 100644
--- a/htdocs/takepos/admin/appearance.php
+++ b/htdocs/takepos/admin/appearance.php
@@ -85,7 +85,7 @@ $formproduct = new FormProduct($db);
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_appearance');
-$linkback = ''.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').''.$langs->trans("GoBack").'';
+$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_admin_prepare_head();
diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php
index 84685e41ad9..f9cd47da91f 100644
--- a/htdocs/takepos/admin/bar.php
+++ b/htdocs/takepos/admin/bar.php
@@ -97,7 +97,7 @@ $arrayofcss = array("/takepos/css/colorbox.css");
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-takepos page-admin_bar');
-$linkback = ''.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').''.$langs->trans("GoBack").'';
+$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_admin_prepare_head();
diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php
index 83ba2c85d43..89984f3f6b1 100644
--- a/htdocs/takepos/admin/receipt.php
+++ b/htdocs/takepos/admin/receipt.php
@@ -94,7 +94,7 @@ $form = new Form($db);
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_receipt');
-$linkback = ''.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').''.$langs->trans("GoBack").'';
+$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index 389a1dcfc71..151e68a698e 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -143,7 +143,7 @@ $help_url = 'EN:Module_Point_of_sale_(TakePOS)';
llxHeader('', $langs->trans("CashDeskSetup"), $help_url, '', 0, 0, '', '', '', 'mod-takepos page-admin_setup');
-$linkback = ''.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').''.$langs->trans("GoBack").'';
+$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php
index c381eb77c8f..9dfd80f1c4e 100644
--- a/htdocs/takepos/admin/terminal.php
+++ b/htdocs/takepos/admin/terminal.php
@@ -180,7 +180,7 @@ $formproduct = new FormProduct($db);
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_terminal');
-$linkback = ''.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').''.$langs->trans("GoBack").'';
+$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_admin_prepare_head();
diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php
index e26369e97a8..d249de6cea5 100644
--- a/htdocs/takepos/floors.php
+++ b/htdocs/takepos/floors.php
@@ -238,13 +238,13 @@ $( document ).ready(function() {
- 1) { ?>
- ';">
trans("Floor")." ".$floor; ?>
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 954056a9e15..d5b7358c735 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -1162,11 +1162,14 @@ $( document ).ready(function() {
}
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
+ // Look for any cash control fence created today on this terminal, regardless of its status,
+ // so the auto-open popup only fires on the first cash control of a calendar day. Without this,
+ // refreshing the browser the same day after closing a fence used to immediately re-fire the
+ // popup because the closed fences were filtered out by the status check (#38597).
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
$sql .= " entity = ".((int) $conf->entity)." AND ";
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
- $sql .= " AND status = 0 ";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
@@ -1414,7 +1417,9 @@ if (!getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
+ hasRight('takepos', 'editlines')) { ?>
+
fetch($placeid);
}
- if ($action == "deleteline" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
+ if ($action == "deleteline" && ($user->hasRight('takepos', 'editlines') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
/*
$permissiontoupdateline = ($user->hasRight('takepos', 'editlines') && ($user->hasRight('takepos', 'editorderedlines') || $line->special_code != "4"));
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
@@ -1032,14 +1032,22 @@ if (empty($reshook)) {
$db->commit();
if (count($invoice->lines) == 0) {
- $invoice->delete($user);
+ // Keep an empty draft invoice alive when a non-default customer was
+ // already attached so deleting the last line does not silently lose
+ // the customer that was just selected (#38219). Only drop the invoice
+ // when it is still on the default cashdesk thirdparty (or none).
+ $defaultsocid = (int) getDolGlobalString('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]);
+ $invoicesocid = (int) $invoice->socid;
+ if ($invoicesocid === 0 || $invoicesocid === $defaultsocid) {
+ $invoice->delete($user);
- if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
- header("Location: ".DOL_URL_ROOT."/takepos/public/auto_order.php");
- } else {
- header("Location: ".DOL_URL_ROOT."/takepos/invoice.php");
+ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
+ header("Location: ".DOL_URL_ROOT."/takepos/public/auto_order.php");
+ } else {
+ header("Location: ".DOL_URL_ROOT."/takepos/invoice.php");
+ }
+ exit;
}
- exit;
}
}
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index 78e7f42f1e6..51dd10e6b01 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -709,6 +709,9 @@ if (empty($reshook)) {
$permissiondellink = $permissiontoadd;
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
+ // Actions when printing a doc from card
+ include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
+
// Actions to build doc
include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';