';
+ }
+
+ print '';
+}
+
/**
- * Show footer of company in HTML pages
+ * Show footer of company in HTML public pages
*
* @param Societe $fromcompany Third party
* @param Translate $langs Output language
diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
index e4199a5bf8e..0b068fbfa22 100644
--- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
@@ -47,7 +47,7 @@ class pdf_proforma extends pdf_eratosthene
*/
public function __construct($db)
{
- global $conf, $langs, $mysoc;
+ global $langs;
parent::__construct($db);
diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php
index 142aaf70270..28db17eceb0 100644
--- a/htdocs/ecm/class/ecmfiles.class.php
+++ b/htdocs/ecm/class/ecmfiles.class.php
@@ -1013,9 +1013,17 @@ class EcmFiles extends CommonObject
} elseif ($option == 'commande_fournisseur') {
$tmppath = preg_replace('/^fournisseur\/commande\//', '', $this->filepath);
} else {
- $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath);
+ if ((int) $this->entity > 1) {
+ // Remove the part "entityid/commande/" into "entityid/commande/REFXXX" to get only the ref
+ $tmppath = preg_replace('/^\d+\/[^\/]+\//', '', $this->filepath);
+ } else {
+ // Remove the part "commande/" into "commande/REFXXX" to get only the ref
+ $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath);
+ }
}
- $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.$this->entity;
+ //var_dump($this->filepath);
+
+ $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.((int) $this->entity);
} else {
$url = DOL_URL_ROOT.'/ecm/file_card.php?id='.$this->id;
}
diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php
index 0711f4597fb..b2baa27b425 100644
--- a/htdocs/expedition/dispatch.php
+++ b/htdocs/expedition/dispatch.php
@@ -785,13 +785,16 @@ if ($object->id > 0 || !empty($object->ref)) {
print ''; // Dispatch column
print '
'; // Warehouse column
- $sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot,";
- $sql .= " eb.batch, eb.eatby, eb.sellby, cd.fk_product";
- $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet";
- $sql .= " JOIN ".MAIN_DB_PREFIX."commandedet as cd on ed.fk_elementdet = cd.rowid";
- $sql .= " WHERE ed.fk_elementdet =".(int) $objp->rowid;
- $sql .= " AND ed.fk_expedition =".(int) $object->id;
+ $sql = "SELECT ed.rowid";
+ $sql .= ", cd.fk_product";
+ $sql .= ", ".$db->ifsql('eb.rowid IS NULL', 'ed.qty', 'eb.qty')." as qty";
+ $sql .= ", ed.fk_entrepot";
+ $sql .= ", eb.batch, eb.eatby, eb.sellby";
+ $sql .= " FROM ".$db->prefix()."expeditiondet as ed";
+ $sql .= " LEFT JOIN ".$db->prefix()."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet";
+ $sql .= " INNER JOIN ".$db->prefix()."commandedet as cd on ed.fk_origin_line = cd.rowid";
+ $sql .= " WHERE ed.fk_origin_line = ".(int) $objp->rowid;
+ $sql .= " AND ed.fk_expedition = ".(int) $object->id;
$sql .= " ORDER BY ed.rowid, ed.fk_elementdet";
$resultsql = $db->query($sql);
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index c0d84059027..a964ea621b4 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -94,7 +94,7 @@ $result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, becaus
$permissiontoread = $user->hasRight('expedition', 'lire');
$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
+$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && ((int) $object->status == $object::STATUS_DRAFT));
$permissionnote = $user->hasRight('expedition', 'creer'); // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php
diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php
index 86150a73118..c3529974a76 100644
--- a/htdocs/fourn/facture/card-rec.php
+++ b/htdocs/fourn/facture/card-rec.php
@@ -737,6 +737,7 @@ if (empty($reshook)) {
unset($_POST['date_end_fill']);
unset($_POST['situations']);
unset($_POST['progress']);
+ unset($_POST['fourn_ref']);
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -879,6 +880,7 @@ if (empty($reshook)) {
unset($_POST['date_endyear']);
unset($_POST['situations']);
unset($_POST['progress']);
+ unset($_POST['fourn_ref']);
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index c89a5f9a3f9..1af4cfa6c57 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -412,6 +412,7 @@ SaleExport=Export sale
SaleEEC=Sale in EEC
SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account.
SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of third party is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the third party, or change the product account suggested for binding if needed.
+AnySale=Any sale
ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported.
ForbiddenTransactionAlreadyValidated=Forbidden: The transaction has been validated.
DataMustHaveBeenTransferredInAccounting=The transfer of data in accounting must have been done
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index df17e0ee429..a8c61ef799f 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2137,6 +2137,7 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF
MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF
DOC_SHOW_FIRST_SALES_REP=Show first sales representative
MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add column for picture on proposal lines
+MAIN_GENERATE_DOCUMENTS_WITH_PICTURE=Add column for picture on document lines
MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width of the column if a picture is added on lines
MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE=Hide the unit price column on quotation requests
MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN=Hide the total price column on quotation requests
@@ -2611,3 +2612,5 @@ UploadExtensionRestriction=List of forbidden file extensions to upload
UploadExtensionRestrictionExemple=htm, html, shtml, js, php
Privileges=Privileges
FieldsLinked=Fields Linked
+PDF_XXX_SHOW_PRICE_INCL_TAX=Show column Price including tax
+AvailableWithSomePDFTemplatesOnly=Feature not supported on old PDF templates
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 1f9126c5962..038534f56fa 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -31,6 +31,7 @@ ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be differen
ErrorBadThirdPartyName=Bad value for third-party name
ForbiddenBySetupRules=Forbidden by setup rules
ErrorProdIdIsMandatory=The %s is mandatory
+ErrorProdIdIsMandatoryForEuThirdparties=The %s is mandatory for customers in EEC
ErrorAccountancyCodeCustomerIsMandatory=The accountancy code of customer %s is mandatory
ErrorAccountancyCodeSupplierIsMandatory=The accountancy code of supplier %s is mandatory
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index b406d67b761..37c0f19ee04 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5561,8 +5561,6 @@ class Product extends CommonObject
*/
public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = array())
{
- global $alreadyfound;
-
if (empty($id)) {
return array();
}
@@ -5579,9 +5577,6 @@ class Product extends CommonObject
dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
- if ($level == 1) {
- $alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
- }
// Protection against infinite loop
if ($level > 30) {
return array();
@@ -5590,14 +5585,16 @@ class Product extends CommonObject
$res = $this->db->query($sql);
if ($res) {
$prods = array();
+ if ($this->db->num_rows($res) > 0) {
+ $parents[] = $id;
+ }
+
while ($rec = $this->db->fetch_array($res)) {
- if (!empty($alreadyfound[$rec['rowid']])) {
+ if (in_array($rec['id'], $parents)) {
dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING);
- if (in_array($rec['id'], $parents)) {
- continue; // We discard this child if it is already found at a higher level in tree in the same branch.
- }
+ continue; // We discard this child if it is already found at a higher level in tree in the same branch.
}
- $alreadyfound[$rec['rowid']] = 1;
+
$prods[$rec['rowid']] = array(
0 => $rec['rowid'],
1 => $rec['qty'],
@@ -5611,7 +5608,6 @@ class Product extends CommonObject
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']);
//$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']);
if (empty($firstlevelonly)) {
- $parents[] = $rec['rowid'];
$listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, $parents);
foreach ($listofchilds as $keyChild => $valueChild) {
$prods[$rec['rowid']]['childs'][$keyChild] = $valueChild;
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index df26dbf783a..40c79fc427e 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -978,7 +978,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
}
}
-
+//htmlPrintOnlineFooter($mysoc, $langs);
llxFooterVierge();
$db->close();
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index 17506fc264a..566b45618cc 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -233,6 +233,7 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') { // Test on pemriss
*/
$form = new Form($db);
+
$head = '';
if (getDolGlobalString('MAIN_SIGN_CSS_URL')) {
$head = ''."\n";
@@ -241,8 +242,12 @@ if (getDolGlobalString('MAIN_SIGN_CSS_URL')) {
$conf->dol_hide_topmenu = 1;
$conf->dol_hide_leftmenu = 1;
+$title = $langs->trans("OnlineSignature");
+
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
\n";
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 3c46fd80675..5e7686e6d52 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2650,7 +2650,7 @@ class User extends CommonObject
public function send_password($user, $password = '', $changelater = 0)
{
// phpcs:enable
- global $conf, $langs, $mysoc;
+ global $conf, $langs;
global $dolibarr_main_url_root;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
@@ -2663,12 +2663,12 @@ class User extends CommonObject
$outputlangs = new Translate("", $conf);
if (isset($this->conf->MAIN_LANG_DEFAULT)
- && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used)
- $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT);
+ && getDolGlobalString('MAIN_LANG_DEFAULT') != 'auto') { // If user has defined its own language (rare because in most cases, auto is used)
+ $outputlangs->getDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT'));
}
- if ($this->conf->MAIN_LANG_DEFAULT) {
- $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT);
+ if (getDolGlobalString('MAIN_LANG_DEFAULT')) {
+ $outputlangs->setDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT'));
} else { // If user has not defined its own language, we used current language
$outputlangs = $langs;
}
@@ -2729,7 +2729,7 @@ class User extends CommonObject
$mailfile = new CMailFile(
$subject,
$this->email,
- $conf->global->MAIN_MAIL_EMAIL_FROM,
+ getDolGlobalString("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", getDolGlobalString("MAIN_MAIL_EMAIL_FROM")),
$mesg,
array(),
array(),
diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php
index 1cbf082dccb..8c11ba5d92f 100644
--- a/htdocs/webportal/class/webportalorder.class.php
+++ b/htdocs/webportal/class/webportalorder.class.php
@@ -166,7 +166,7 @@ class WebPortalOrder extends Commande
*/
public function getTooltipContentArray($params)
{
- global $conf, $langs;
+ global $langs;
$datas = [];
@@ -174,9 +174,8 @@ class WebPortalOrder extends Commande
return ['optimize' => $langs->trans("WebPortalOrder")];
}
$datas['picto'] = img_picto('', $this->picto) . ' ' . $langs->trans("WebPortalOrder") . '';
- if (isset($this->status)) {
- $datas['picto'] .= ' ' . $this->getLibStatut(5);
- }
+ $datas['picto'] .= ' ' . $this->getLibStatut(5);
+
$datas['ref'] .= ' ' . $langs->trans('Ref') . ': ' . $this->ref;
return $datas;